Skip to content

Fix agent jobs finalization race and reduce status polling churn#14843

Merged
daveaitel-openai merged 1 commit intomainfrom
codex/agent-jobs-issue-13948-clean
Mar 17, 2026
Merged

Fix agent jobs finalization race and reduce status polling churn#14843
daveaitel-openai merged 1 commit intomainfrom
codex/agent-jobs-issue-13948-clean

Conversation

@daveaitel-openai
Copy link
Copy Markdown
Contributor

Summary

  • make report_agent_job_result atomically transition an item from running to completed while storing result_json
  • remove brittle finalization grace-sleep logic and make finished-item cleanup idempotent
  • replace blind fixed-interval waiting with status-subscription-based waiting for active worker threads
  • add state runtime tests for atomic completion and late-report rejection

Why

This addresses the race and polling concerns in #13948 by removing timing-based correctness assumptions and reducing unnecessary status polling churn.

Validation

  • cd codex-rs && just fmt
  • cd codex-rs && cargo test -p codex-state
  • cd codex-rs && cargo test -p codex-core --test all suite::agent_jobs
  • cd codex-rs && cargo test
    • fails in an unrelated app-server tracing test: message_processor::tracing_tests::thread_start_jsonrpc_span_exports_server_span_and_parents_children timed out waiting for response

Notes

Fixes #13948

@daveaitel-openai daveaitel-openai merged commit ef36d39 into main Mar 17, 2026
32 checks passed
@daveaitel-openai daveaitel-openai deleted the codex/agent-jobs-issue-13948-clean branch March 17, 2026 14:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants