Skip to content

fix(vscode): preserve revert workspace status - #13104

Merged
johnnyeric merged 1 commit into
mainfrom
johnnyeric/fix-revert-workspace-status
Aug 13, 2026
Merged

fix(vscode): preserve revert workspace status#13104
johnnyeric merged 1 commit into
mainfrom
johnnyeric/fix-revert-workspace-status

Conversation

@johnnyeric

@johnnyeric johnnyeric commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Issue

Fixes #13083

Context

Fresh reverts returned an explicit workspace restoration outcome from the backend, but the follow-up session.updated event encoded through the legacy session contract silently dropped revert.workspace. VS Code then replaced its current session state with that stripped event and displayed the fallback for an earlier/legacy revert.

This preserves the actual restoration outcome so current reverts are no longer misclassified.

Implementation

Add the optional workspace restoration outcome to both current and V1 revert schemas, regenerate the affected API/client types, and add focused encoding and generated-contract regressions. The snapshot implementation is intentionally unchanged because direct fresh-file restoration already passes and is separate from the confirmed serialization defect.

Screenshots / Video

Before

Screenshot 2026-08-13 at 14 18 58

After

Screenshot 2026-08-13 at 14 16 56 Screenshot 2026-08-13 at 14 17 09

How to Test

Manual/local verification

Agent-executed:

  • bun test test/legacy-event.test.ts test/revert.test.ts in packages/schema — 4 passed
  • bun test tests/unit/revert-checkpoints.test.ts in packages/kilo-vscode — 7 passed
  • Schema and VS Code typechecks passed
  • VS Code lint and the OpenCode annotation guard passed
  • The pre-push typecheck passed across all packages, including JetBrains with Java 21

Reviewer test steps

  1. Launch an isolated extension build with bun run extension:isolated:clean -- <test-folder>.
  2. Start a fresh session and ask Kilo to create a new file.
  3. Revert the user message immediately.
  4. Confirm the new file is removed and the banner does not describe the action as an earlier revert.
  5. Run the two focused test commands above to verify both current and legacy wire contracts preserve workspace.

Blocked checks and substitute verification

  • Native Windows 11 extension verification was not available locally. Substitute verification covered the exact pre-fix serialization failure, the fixed encode path, direct fresh-file snapshot restoration under Windows-style Git settings.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@johnnyeric
johnnyeric force-pushed the johnnyeric/fix-revert-workspace-status branch from 533b12f to b9d800d Compare August 13, 2026 11:32
@johnnyeric
johnnyeric force-pushed the johnnyeric/fix-revert-workspace-status branch from b9d800d to cb8ee4f Compare August 13, 2026 11:40
@johnnyeric
johnnyeric marked this pull request as ready for review August 13, 2026 11:42
@kilo-code-bot

kilo-code-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

lgtm — the schema additions match the surrounding conventions (.pipe(optional) in revert.ts, optional(...) in v1/session.ts, Schema.Literals for the closed outcome set), workspace stays optional in the regenerated OpenAPI/SDK/client types, and the new tests encode the real schemas rather than duplicating logic. The change is coherent with the pre-existing runtime side (rev.workspace assignment in packages/opencode/src/session/revert.ts and the fromRow projection), so this completes the wire contracts that were silently dropping the field. Changeset is present and user-facing.

Files Reviewed (8 files)
  • .changeset/revert-workspace-status.md
  • packages/client/src/generated/types.ts
  • packages/kilo-vscode/tests/unit/revert-checkpoints.test.ts
  • packages/schema/src/revert.ts
  • packages/schema/src/v1/session.ts
  • packages/schema/test/kilocode/revert-workspace.test.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json

Reviewed by kimi-k3 · Input: 211.8K · Output: 7.9K · Cached: 416.4K

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric merged commit 9b01d97 into main Aug 13, 2026
32 checks passed
@johnnyeric
johnnyeric deleted the johnnyeric/fix-revert-workspace-status branch August 13, 2026 13:22
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows / VS Code 7.4.21: fresh session revert treated as “earlier revert” and does not restore workspace files

2 participants