Skip to content

fix: preserve sibling session metadata namespace fields - #718

Merged
benbrandt merged 1 commit into
mainfrom
fix/session-metadata-writers
Nov 1, 2026
Merged

benbrandt merged 1 commit into
mainfrom
fix/session-metadata-writers

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

  • Compose complete v2 codex and jetbrains.air values in their owned writers, using the serialized session metadata owner from fix: resynchronize current session metadata on ACP v2 resume #717. A status/goal/failure/report/archive update no longer drops sibling fields merely because v2 replaces the whole top-level namespace value.
  • Keep composition after event routing, so child-view facts read and update the child's metadata rather than the parent's.
  • Generalize the existing AIR metadata builder for multiple owned fields and reuse it for event-handler facts, goal publication, file-change reports, and archive updates. Raw transport metadata still follows shallow replacement semantics; this does not introduce a generic deep merge.
  • Retain metadata through nested close/archive operations until the final publication fence is sealed. Foreground teardown still happens at runtime close, but archive can compose its final metadata with the current sibling values before disposal. Late publication remains fenced.
  • Preserve accompanying session info fields in the same composed update. Keep all v1 payloads unchanged.

Checked against ACP a965f1f1, docs/protocol/v2/extensibility.mdx:103-150: each top-level metadata value is replaced whole, and nested nulls are ordinary data. Producers that share a namespace therefore need to construct its current complete value, rather than relying on clients to deep-merge their partial objects.

Scope and cost

This preserves the current namespace layout and extension contract. Complete namespace updates may repeat unchanged values, including file-change reports and failure revisions. Splitting metadata keys or moving request-scoped report data to a different notification location would be a separate compatibility decision. Native setup seeding and newer upstream schema additions are not redesigned here. No review/checklist Markdown file is added.

Validation

  • npm run typecheck
  • npm run build
  • npm test: 2,365 passed, 39 skipped
  • npm run test:integration: all 19 passed
  • npm run codex-test -- -p "Reply with exactly OK. Do not use tools or modify any files." -o summary: completed with end_turn
  • git diff --check
  • Opt-in E2E tests were not run.

New wire tests exercise the actual goal, local-command file-report, typed-failure, goal-clear, and archive sequence on both protocol versions, including post-archive suppression. They also cover independent Codex fields, concurrent AIR writers, unrelated JetBrains/root fields, nested nulls, and routed child isolation. A metadata-owner test covers accompanying title/activity fields. All existing snapshots, including v1 snapshots, remain unchanged.

@benbrandt
benbrandt merged commit 3720341 into main Nov 1, 2026
6 checks passed
@benbrandt
benbrandt deleted the fix/session-metadata-writers branch November 1, 2026 19:42
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.

1 participant