Skip to content

[#83]: rename CollabSpawn output field new_thread_id to new_session_id for Codex v0.131.0#93

Merged
delexw merged 1 commit into
mainfrom
fix-issue-83
Jun 3, 2026
Merged

[#83]: rename CollabSpawn output field new_thread_id to new_session_id for Codex v0.131.0#93
delexw merged 1 commit into
mainfrom
fix-issue-83

Conversation

@delexw
Copy link
Copy Markdown
Contributor

@delexw delexw commented May 31, 2026

Summary

Completes the Codex v0.131.0 (PR #22268) compatibility fix for hook payload field rename: new_thread_idnew_session_id.

The parser already reads both field names for backward compatibility (landed in #69 for issue #63). This PR completes the fix by updating the output format: the serialized CollabSpawn JSON key and TypeScript interface still exposed new_thread_id to API consumers even when the underlying value was a session ID (for v0.131.0+ sessions).

Changes

  • src-tauri/src/parser/turn.rs: Renamed CollabSpawn.new_thread_idnew_session_id in the Rust struct; updated field read order to prefer new_session_id first with new_thread_id as backward-compat fallback; updated struct initialization and all test assertions
  • src-tauri/src/parser/session.rs: Updated spawned_worker_ids collection and embed_worker_sessions subagent stitching to use new_session_id; added end-to-end integration test v0131_parse_session_stitches_worker_via_new_session_id verifying full parse → stitch pipeline with new_session_id
  • shared/types.ts: Updated CollabSpawn TypeScript interface to match the renamed JSON key

Backward Compatibility

Pre-v0.131.0 JSONL files that contain new_thread_id in collab_agent_spawn_end events continue to parse correctly — the parser tries new_session_id first, then falls back to new_thread_id.

Verification

  • All 132 Rust unit tests pass
  • All 128 frontend vitest tests pass
  • TypeScript type check clean
  • Clippy clean (-D warnings)
  • HTTP API smoke test: /api/settings returns valid JSON

Fixes #83

…odex v0.131.0

Codex v0.131.0 (PR #22268) renamed the collab_agent_spawn_end hook event
field new_thread_id to new_session_id. While the parser already reads both
field names for backward compat, the output format still exposed
CollabSpawn.new_thread_id to API consumers even for v0.131.0+ data where
the value is actually a session ID.

This commit completes the fix by:
- Renaming CollabSpawn.new_thread_id to new_session_id in the Rust struct
  and TypeScript interface so the serialized JSON key matches the Codex API
- Updating field read order: try new_session_id first, fall back to
  new_thread_id for pre-v0.131.0 compatibility
- Updating all callers in session.rs (spawned_worker_ids collection and
  embed_worker_sessions subagent stitching)
- Adding end-to-end session-level test: parse_session stitches a worker
  session using new_session_id from a v0.131.0 collab_agent_spawn_end event

Fixes #83
@delexw delexw merged commit 9fb31e5 into main Jun 3, 2026
1 check passed
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.

[Compat] Codex v0.131.0: Hooks now carry session IDs instead of thread IDs

1 participant