mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
Add optional names to untrusted additional context (#57181)
## What changed
- Add an optional `name` to `AdditionalContextEntry` across the protocol, app-server schemas, and generated clients.
- Accept names matching `[a-z][a-z0-9_]{0,63}` only for `untrusted` context. Reject invalid names and names on `application` context before admitting turn input, returning invalid-request errors from `turn/start` and `turn/steer`.
- Preserve existing model-input rendering and deduplicate context when only its name changes.
## Testing
Add coverage for valid name boundaries, callers that omit `name`, invalid-name rejection without admitting input, and deduplication across name changes.
GitOrigin-RevId: 2caffa6fddd40ddb178733b335f520f317239edd
This commit is contained in:
@@ -235,6 +235,12 @@ pub(super) async fn handle(
|
||||
submission_id: String,
|
||||
) -> CodexResult<TurnInputSubmission> {
|
||||
let request = request.into();
|
||||
request
|
||||
.request
|
||||
.additional_context
|
||||
.values()
|
||||
.try_for_each(AdditionalContextEntry::validate)
|
||||
.map_err(|message| CodexErr::InvalidRequest(message.to_owned()))?;
|
||||
let result = match mode {
|
||||
TurnInputMode::StartOrSteer => start_or_steer(session, request, submission_id).await,
|
||||
TurnInputMode::StartIfIdle => {
|
||||
|
||||
Reference in New Issue
Block a user