Skip to content

Add untrusted external messages to the Python SDK - #44086

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6106327085fd9c4bd11b71e20b3d8e74738b8bb5
Sep 9, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6106327085fd9c4bd11b71e20b3d8e74738b8bb5

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Add untrusted external messages to the Python SDK

Why

Applications need to deliver content from other agents, tools, or services with tool-level authority, without treating it as user input or granting authorization.

What changed

  • Export ExternalMessage for sync and async run(...) and turn(...), accepting text or structured content with a tool name and optional namespace. Send it through toolOutput and require CLI 0.151.0 or newer.
  • Support starting a turn or joining an active regular turn while preserving external content as function output in history. Keep external messages separate from user-input lists and steer(...).
  • Give turn handles independent subscriptions, replaying completed items and latest usage to joining handles. Release consumed transient events and clean up subscriptions on closure, failure, or cancellation.
  • Document the authority boundary and add sync and async examples.

Testing

Add coverage for wire representations, input validation, runtime compatibility, tool authority across resume, active-turn joins, and tool-output truncation. Add subscription tests for replay, concurrent consumers, early completion, cancellation, and cleanup.

## Why

Applications need to deliver content from other agents, tools, or services with tool-level authority, without treating it as user input or granting authorization.

## What changed

- Export `ExternalMessage` for sync and async `run(...)` and `turn(...)`, accepting text or structured content with a tool name and optional namespace. Send it through `toolOutput` and require CLI 0.151.0 or newer.
- Support starting a turn or joining an active regular turn while preserving external content as function output in history. Keep external messages separate from user-input lists and `steer(...)`.
- Give turn handles independent subscriptions, replaying completed items and latest usage to joining handles. Release consumed transient events and clean up subscriptions on closure, failure, or cancellation.
- Document the authority boundary and add sync and async examples.

## Testing

Add coverage for wire representations, input validation, runtime compatibility, tool authority across resume, active-turn joins, and tool-output truncation. Add subscription tests for replay, concurrent consumers, early completion, cancellation, and cleanup.

GitOrigin-RevId: 6106327085fd9c4bd11b71e20b3d8e74738b8bb5
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6106327085fd9c4bd11b71e20b3d8e74738b8bb5 branch from dfcd64f to 1a4096e Compare September 9, 2026 06:54
@copyberry
copyberry Bot merged commit 1a4096e into main Sep 9, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6106327085fd9c4bd11b71e20b3d8e74738b8bb5 branch September 9, 2026 06:54
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 9, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 1a4096e2 Deployed Sep 9, 2026 by zhangzexin via Translate non-English issue #12093
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.

3 participants