Expose the persisted patch ledger through operation_status - #58
Merged
Merged
Conversation
Lookup now returns files, hashes, and minted/finished events so agents can recover patch state without mixing exec process handles into the operations table. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #
Summary
operation_statusnow returns the recorded patch ledger so a client can recover files, before/after hashes, and minted/finished events after a lost apply response. Commands stay onprocess_idand are not written tooperations.Contract changes
operation_statusremains the same tool name (LIVE_TOOLSunchanged). XOR lookup (operation_idoroperation_key) and lookupreplayed: falseare unchanged.OperationStatusResultfields:kind("patch"),workspace_id,created_at, optionalfinished_at,files,changes,events.finished_at. A transport-ambiguous close records afinishedevent withreason: "unknown".finished_atandevents_jsonvia idempotentALTER TABLE.Tests
Verified locally:
cargo test -p codespace-domain -p codespace-store --offlinecargo clippy -p codespace-domain -p codespace-store -p codespace-server --all-targets --offline -- -D warningscargo test -p codespace-server --offline --lib apply_patch_uds_losscargo test -p codespace-server --offline --test operations --test protocol_compat --test rollbackpython3 -B scripts/check_docs.py checkSecurity scenarios
operation_id/operation_keyremain selectors, not credentials.process_idis not recoverable throughoperation_status, so a lookup cannot be mistaken for process recovery after restart or UDS loss.Out of scope
operationsor looking up commands viaoperation_statusLIVE_TOOLSchanges, Runner DTO operation identifiersfs/watch, PTY resize, disconnect recovery, resource schedulerMade with Cursor