Repository navigation
fix(core): prevent automatic turn span nesting - #24809
fcoury-oai wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cab71c1911
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Why
Automatic
/goalcontinuation turns are currently started while the completingturntracing span is still active. The SQLite log store persists full span ancestry in each event body, so successive automatic turns can serialize an increasingly deepturn{...}:turn{...}chain. In #23340, that produced hundreds-of-kilobyte log rows and a 34 GB log database within a day.This addresses the nested-span amplification. Repeated invalid skill/icon diagnostic warnings remain a separate problem covered by the proposed reopening/follow-up to #21274.
Fixes #23340.
What changed
TurnSpanParentpolicy for task-ownedturnspans.turnspans.TurnStartedrather than the completed parent trace.How to Test
Automated verification run:
just test -p codex-core spawn_task_turn_span_inherits_dispatch_trace_contextjust test -p codex-core regular_turn_emits_turn_started_with_trace_id_without_waiting_for_startup_prewarmjust test -p codex-core root_task_turn_span_does_not_inherit_current_trace_contextjust test -p codex-core rooted_regular_turn_does_not_emit_parent_trace_idjust fmtjust fix -p codex-coreAdditional checks attempted:
just test -p codex-corecurrently fails in unrelated existing/environment-sensitive tests:thread_manager::tests::start_thread_uses_all_default_environments_from_codex_hometimed out, andsuite::user_shell_cmd::user_shell_command_does_not_set_network_sandbox_env_varobservesCODEX_SANDBOX_NETWORK_DISABLED=1in this sandbox.just argument-comment-lintis blocked before checking source by the Bazel LLVMcompiler-rttarget missinginclude/sanitizer/*.h; the touched Rust callsites were manually inspected and the introduced opaque literal callsites are annotated.Manual verification:
turn{...}ancestors and itsTurnStarted.trace_idnames the new task trace, while a directly submitted turn still correlates to its submission trace.