进阶 zcode.z.ai 2026-11-25 14:51:22 · 0 阅读

第34章 Edit History

Core FeaturesEdit History ZCode lets you edit your last sent message to add requirements, adjust the scope, or change the output format. When you resend it, the Agent runs the revised instruction in the current chat, replacing the original reply and execution record for that turn. Earlier turns remain unchanged. You can keep the current files or restore the changes from that turn before rerunning. Queued messages can also be loaded into the composer for revision. Current sessionEarlier turnsUnchangedLast turnReplaced after editingFill in README and package.json2 files changed+45−3SendNew reply replaces this turn; files stay as they areReset chat + filesRestores this turn's files first, then runs againTo change files onlyUndorestores this turn's files; the conversation stays Edit a Message Hover over your last sent user message and select Edit (the pencil icon). The message's text, attachments, and the model and execution mode it was sent with are loaded into the composer at the bottom; the top of the composer shows Editing your last message, and Editing below appears under the original message. Any draft already in the composer is set aside and restored after you cancel or submit. Editing is available for the last user message in the current chat, including while the Agent is running. Submitting the revised instruction stops the current execution and reruns the turn. Read-only chats do not provide an edit action. If the composer is sending or an attachment is still uploading, wait for it to finish before editing. Revise and Rerun Update the instruction in the composer. It works as usual while editing: use @ to add file context, use / to choose a command, add or remove attachments, or switch the model and execution mode. Reset chat + files and Cancel sit on the right of the edit status bar at the top of the composer; sending still uses the composer's send button or Enter. Pressing Esc does not leave edit mode. 1Cancel editing2Reset chat + files: restore files and rerun3Send: keep files and rerun Choose an action for the task: ActionExecutionFilesSendReruns the revised instructionKeeps the current file contentsReset chat + filesReruns the revised instruction after restoring filesRestores recoverable changes from this turn to their pre-run stateCancelCloses the editor and keeps the original message and replyKeeps the current file contents To change the response format, select Send. To start again from the file state before this turn, choose Reset chat + files. Restore Files Before Rerunning Reset chat + files first checks the recovery records and current file contents. ZCode sends the revised instruction after the files are successfully restored. If restoration fails, execution does not proceed. Reset chat + filesChoose this after revising the instructionCheck recovery recordsCompares this turn's records with the current filesRestore filesExisting files go back; files created in the turn are removedSend againThe revised instruction goes outIf restoration fails, nothing runs; check the files, or choose “Reset chat only and send” Restoration covers changes with usable recovery records from this turn: existing files return to their previous contents, and files created in the turn are removed. This uses the turn's recovery records rather than reverting to a Git commit. File reset may be unavailable when: The turn has no recoverable file changes, or the changes have already been undone. Execution is still running, context is being compacted, or an interaction is pending. Files have been modified by other operations, or the turn includes terminal-command changes that cannot be fully restored. If Files could not be safely reset appears, check the files first or choose Reset chat only and send to rerun with the current file contents. Edit Queued Messages When interaction behavior is set to Queue, messages sent while the Agent is working enter the queued messages list. Select Edit on a queued message to load its text, attachments, model, and execution mode into the composer; the top of the composer shows Editing a queued message. The message keeps its place in the queue and shows Editing below. Sending saves the changes to the same position in the queue; Cancel leaves the message as it was. If you changed the model or execution mode while editing and other messages are still queued, ZCode asks whether to Apply to queue; choose Only this message to change just this one. If the composer is sending or an attachment is still uploading, wait for it to finish before editing. Compaction commands such as /compact do not support this action. Undo File Changes The file change summary for each turn provides Undo, which restores that turn's file changes while preserving the chat record. Selecting Undo opens a dialog listing files that can be safely undone, files that cannot, and files that are ignored. Review the list and select Undo files. The change summary shows Undone when complete. Undo is unavailable while the chat is running or has a pending request; try again once it finishes. A file is listed as unsafe to undo when it has been changed by another program, when this turn's recovery record is missing or unreadable, when the record comes from an older version and cannot be restored safely, or when the current file cannot be read. Changes made by terminal commands are listed as ignored. Change summary2 files changed+45−3UndoUndo file changesFile content is checked again before writingSafe to undo 2README.md1 changepackage.json1 changeUnsafe to undo 0Ignored 1npm installbash/shell change ignoredUndo filesChange summary2 files changedUndoneChat history staysWhy a file is unsafe to undoChanged externallyCheckpoint missing or unreadableOld checkpointCurrent file unreadable File contents are checked again before the undo. If any file included in the recovery cannot be restored safely, no files are written. Changes made by terminal commands are outside the undo scope and require separate handling. The current version does not provide a reapply action. To recover undone content, use an existing commit, backup, or editor history, or ask the Agent to generate it again. Next Steps Task & File ManagementBrowse workspace files, review changes, and manage tasks.CommandSave common prompts as reusable commands.

评论 (0)