[#83]: rename CollabSpawn output field new_thread_id to new_session_id for Codex v0.131.0#93
Merged
Conversation
…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
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.
Summary
Completes the Codex v0.131.0 (PR #22268) compatibility fix for hook payload field rename:
new_thread_id→new_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
CollabSpawnJSON key and TypeScript interface still exposednew_thread_idto API consumers even when the underlying value was a session ID (for v0.131.0+ sessions).Changes
src-tauri/src/parser/turn.rs: RenamedCollabSpawn.new_thread_id→new_session_idin the Rust struct; updated field read order to prefernew_session_idfirst withnew_thread_idas backward-compat fallback; updated struct initialization and all test assertionssrc-tauri/src/parser/session.rs: Updatedspawned_worker_idscollection andembed_worker_sessionssubagent stitching to usenew_session_id; added end-to-end integration testv0131_parse_session_stitches_worker_via_new_session_idverifying full parse → stitch pipeline withnew_session_idshared/types.ts: UpdatedCollabSpawnTypeScript interface to match the renamed JSON keyBackward Compatibility
Pre-v0.131.0 JSONL files that contain
new_thread_idincollab_agent_spawn_endevents continue to parse correctly — the parser triesnew_session_idfirst, then falls back tonew_thread_id.Verification
-D warnings)/api/settingsreturns valid JSONFixes #83