Skip to content

fix(session): recover stale controller transcripts#5856

Merged
SivanCola merged 5 commits into
main-v2from
fix/session-conflict-recovery
Jul 3, 2026
Merged

fix(session): recover stale controller transcripts#5856
SivanCola merged 5 commits into
main-v2from
fix/session-conflict-recovery

Conversation

@SivanCola

@SivanCola SivanCola commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • save divergent stale controller transcripts into deterministic recovery branch sessions instead of dropping local-only turns or auto-merging unsafe JSONL histories
  • add persistent transcript revision/CAS metadata (revision, content_digest, writer_id) so snapshot/rewrite saves only commit from the controller's recorded disk baseline, while listing/meta updates preserve those persistence fields
  • add long-lived runtime leases with an in-process owner registry plus Unix flock / Windows LockFileEx lease files, and wire desktop tab build/rebind/close/recovery paths so one writable runtime owns a session path
  • keep pure stale-prefix conflicts adopting the newer disk transcript, and surface recovery sessions in desktop tabs/project tree with recovery metadata, warning toast action, sidebar badge, and recovery banner

Refs #5783

Verification

  • go test -count=1 ./internal/agent
  • go test -count=1 ./internal/control ./internal/boot
  • cd desktop && go test -count=1 .
  • pnpm --dir desktop/frontend typecheck
  • pnpm --dir desktop/frontend check:css
  • pnpm --dir desktop/frontend exec tsx src/__tests__/project-tree-runtime.test.ts
  • GOOS=windows GOARCH=amd64 go test -c ./internal/agent -o "<tmp>/agent.test.exe"
  • GOOS=linux GOARCH=amd64 go test -c ./internal/agent -o "<tmp>/agent.test"
  • git diff --check

Cache impact

Cache-impact: none; this changes session persistence/recovery, sidecar metadata, and desktop runtime ownership, not provider-visible prompts, model input shaping, tool schemas, or cache key behavior.
Cache-guard: go test -count=1 ./internal/agent; go test -count=1 ./internal/control ./internal/boot; cd desktop && go test -count=1 .; pnpm --dir desktop/frontend typecheck; pnpm --dir desktop/frontend check:css; pnpm --dir desktop/frontend exec tsx src/__tests__/project-tree-runtime.test.ts; GOOS=windows GOARCH=amd64 go test -c ./internal/agent -o "<tmp>/agent.test.exe"; GOOS=linux GOARCH=amd64 go test -c ./internal/agent -o "<tmp>/agent.test".
System-prompt-review: no provider-visible system prompt, memory prefix, output style, skill index, or tool schema behavior changes.

@SivanCola SivanCola requested a review from esengine as a code owner July 3, 2026 08:53
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant