Skip to content

Prevent shared instruction providers from delegating to themselves - #50093

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7b6b2f9031f206e203f6fa14e1478a36b305ec39
Oct 1, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7b6b2f9031f206e203f6fa14e1478a36b305ec39

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Prevent shared instruction providers from delegating to themselves

Why

Reloading an unloaded root from a surviving child can supply the shared instruction wrapper already registered for that root. Replacing its underlying provider with that same wrapper makes instruction loading recurse into itself.

What changed

Reuse the existing wrapper without replacing its provider when both are the same Arc. Continue to accept distinct replacement providers.

Testing

Extend regression coverage to reload the root from a surviving child and verify that shared instructions still update. Check wrapper reuse, replacement with a distinct shared provider, and freezing the shared snapshot when switching to a provider that does not share with subagents.

…50093)

## Why

Reloading an unloaded root from a surviving child can supply the shared instruction wrapper already registered for that root. Replacing its underlying provider with that same wrapper makes instruction loading recurse into itself.

## What changed

Reuse the existing wrapper without replacing its provider when both are the same `Arc`. Continue to accept distinct replacement providers.

## Testing

Extend regression coverage to reload the root from a surviving child and verify that shared instructions still update. Check wrapper reuse, replacement with a distinct shared provider, and freezing the shared snapshot when switching to a provider that does not share with subagents.

GitOrigin-RevId: 7b6b2f9031f206e203f6fa14e1478a36b305ec39
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/7b6b2f9031f206e203f6fa14e1478a36b305ec39 branch from bf98eeb to 9d53dd9 Compare October 1, 2026 20:45
@copyberry
copyberry Bot merged commit 9d53dd9 into main Oct 1, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/7b6b2f9031f206e203f6fa14e1478a36b305ec39 branch October 1, 2026 20:45
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 1, 2026
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.

1 participant