Skip to content

Fix concurrent cold-start race on shared agent instance (CAN-292) - #80

Draft
nickhuo wants to merge 1 commit into
mainfrom
nickhuo/can-292-concurrent-dispatch-race
Draft

Fix concurrent cold-start race on shared agent instance (CAN-292)#80
nickhuo wants to merge 1 commit into
mainfrom
nickhuo/can-292-concurrent-dispatch-race

Conversation

@nickhuo

@nickhuo nickhuo commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Problem description:

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Concurrent worker threads dispatch onto a single shared Agent instance;
a fresh LLM client's one-time lazy schema init (e.g. pydantic core
schema build) can race when two cold-start requests land at once,
intermittently failing one of them. Gate the agent's first call behind
a lock until it completes; once warmed up, calls skip the lock and run
fully concurrently as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nickhuo
nickhuo force-pushed the nickhuo/can-292-concurrent-dispatch-race branch from e6df3f0 to 675b836 Compare September 9, 2026 22:38
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