Skip to content

core: preserve thread activity through completion#31350

Open
winston-openai wants to merge 1 commit into
dev/winston/thread-idle-shutdown-startupfrom
dev/winston/thread-idle-shutdown-completion
Open

core: preserve thread activity through completion#31350
winston-openai wants to merge 1 commit into
dev/winston/thread-idle-shutdown-startupfrom
dev/winston/thread-idle-shutdown-completion

Conversation

@winston-openai

Copy link
Copy Markdown
Contributor

Summary

  • hold the exact thread-activity reservation from accepted turn dispatch through terminal delivery
  • preserve the reservation across replacement and interrupt-to-restart transitions
  • keep V1 completion watchers bound to the exact child session and hold activity through V1/V2 parent notification
  • enumerate descendants from the stable ThreadId ancestry so unloading an intermediate agent cannot hide a live grandchild

This is the final core layer of the thread-bound idle shutdown stack and depends on #31349.

Test plan

  • CARGO_INCREMENTAL=0 just test -p codex-core 'accepted_submission_can_start_before_queued_shutdown' 'activity_reservations_are_atomic_and_survive_session_teardown' 'try_start_turn_if_idle_rejects_active_turn_without_injecting' 'interrupt_waits_for_idle_turn_start_to_install_task' 'replacement_holds_thread_activity_through_startup' 'task_finish_retries_trigger_mail_that_arrives_before_active_turn_clears' 'task_finish_emits_thread_idle_lifecycle_after_active_turn_clears' 'idle_shutdown_claim_waits_for_submissions_and_blocks_automatic_turns' 'spawn_child_completion_notifies_parent_history' 'multi_agent_v2_completion_queues_message_for_direct_parent' 'completion_watcher_notifies_parent_when_child_is_missing' 'idle_parent_cannot_shutdown_while_unpublished_child_waits_for_approval'
  • CARGO_INCREMENTAL=0 just fix -p codex-core
  • just fmt
  • independent principal review: 10 focused checks passed

Stack

@winston-openai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c9d6f4f444

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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