Skip to content

Parallelize instruction refresh and tool preparation - #47458

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6b2d7b091aae2dba67ad154a19bdb0ed0f96f6f7
Sep 23, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6b2d7b091aae2dba67ad154a19bdb0ed0f96f6f7

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Parallelize instruction refresh and tool preparation

What changed

Run AGENTS.md and thread-instruction refresh concurrently with capability discovery, MCP setup, and tool construction. Box both preparation futures to keep them off caller stacks while they are live together.

Finish delivering returned instruction warnings even when tool preparation fails or is cancelled. Preserve instruction-error precedence and publish the selected-plugin snapshot only after both branches succeed and cancellation is checked.

Testing

Add tests covering concurrent preparation, warning delivery on tool failure and cancellation, instruction-error precedence, and plugin snapshot publication. Verify that cancellation does not repeat consumed warnings on the next capture.

## What changed

Run `AGENTS.md` and thread-instruction refresh concurrently with capability discovery, MCP setup, and tool construction. Box both preparation futures to keep them off caller stacks while they are live together.

Finish delivering returned instruction warnings even when tool preparation fails or is cancelled. Preserve instruction-error precedence and publish the selected-plugin snapshot only after both branches succeed and cancellation is checked.

## Testing

Add tests covering concurrent preparation, warning delivery on tool failure and cancellation, instruction-error precedence, and plugin snapshot publication. Verify that cancellation does not repeat consumed warnings on the next capture.

GitOrigin-RevId: 6b2d7b091aae2dba67ad154a19bdb0ed0f96f6f7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6b2d7b091aae2dba67ad154a19bdb0ed0f96f6f7 branch from 5f27f04 to 0a2eb46 Compare September 23, 2026 05:22
@copyberry
copyberry Bot merged commit 0a2eb46 into main Sep 23, 2026
1 check failed
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6b2d7b091aae2dba67ad154a19bdb0ed0f96f6f7 branch September 23, 2026 05:22
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.