Skip to content

Persist and prewarm agent tasks per thread#17978

Open
adrian-openai wants to merge 2 commits intodev/adrian/codex/agent-identity-register-taskfrom
dev/adrian/codex/agent-task-state-prewarm
Open

Persist and prewarm agent tasks per thread#17978
adrian-openai wants to merge 2 commits intodev/adrian/codex/agent-identity-register-taskfrom
dev/adrian/codex/agent-task-state-prewarm

Conversation

@adrian-openai
Copy link
Copy Markdown
Contributor

Summary

  • persist registered agent tasks in the session state update stream so the thread can reuse them
  • prewarm task registration once identity registration succeeds, while keeping startup failures best-effort
  • isolate the session-side task lifecycle into a dedicated module so AgentIdentityManager and RegisteredAgentTask do not leak across as many core layers

Testing

  • cargo test -p codex-core startup_agent_task_prewarm
  • cargo test -p codex-core cached_agent_task_for_current_identity_clears_stale_task
  • cargo test -p codex-core record_initial_history_

use tokio::time::timeout;

const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10);
const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(20);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to change all the test timings for this? was it flaky?

use tokio::time::timeout;

const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10);
const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(20);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to change all the test timings for this? was it flaky?

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.

2 participants