Add ephemeral turn context support

Introduce app-server ephemeralContext, render it as additional_context_for_this_turn fragments, and strip it correctly across contextual-user diffing and compaction flows.

Regenerate app-server schema fixtures and add coverage for model-visible layout, compaction, oversize validation, and resumed/forked context reconstruction.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-13 11:41:35 -07:00
co-authored by Codex
parent 4bcfdafd01
commit 72d53a2c9b
54 changed files with 1422 additions and 26 deletions
@@ -513,6 +513,23 @@
],
"type": "object"
},
"EphemeralContext": {
"properties": {
"text": {
"description": "Free-form text payload for additional context sent with one turn.",
"type": "string"
},
"title": {
"description": "Human-readable title for additional context sent with one turn.",
"type": "string"
}
},
"required": [
"text",
"title"
],
"type": "object"
},
"ExperimentalFeatureListParams": {
"properties": {
"cursor": {
@@ -2941,6 +2958,16 @@
],
"description": "Override the reasoning effort for this turn and subsequent turns."
},
"ephemeralContext": {
"description": "Additional model-visible context for this turn, such as editor or IDE state. This context is not re-injected automatically after compaction, so clients should send a fresh snapshot on each turn instead of expecting it to carry forward automatically.",
"items": {
"$ref": "#/definitions/EphemeralContext"
},
"type": [
"array",
"null"
]
},
"input": {
"items": {
"$ref": "#/definitions/UserInput"
@@ -6828,6 +6828,23 @@
],
"type": "object"
},
"EphemeralContext": {
"properties": {
"text": {
"description": "Free-form text payload for additional context sent with one turn.",
"type": "string"
},
"title": {
"description": "Human-readable title for additional context sent with one turn.",
"type": "string"
}
},
"required": [
"text",
"title"
],
"type": "object"
},
"ErrorNotification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -13206,6 +13223,16 @@
],
"description": "Override the reasoning effort for this turn and subsequent turns."
},
"ephemeralContext": {
"description": "Additional model-visible context for this turn, such as editor or IDE state. This context is not re-injected automatically after compaction, so clients should send a fresh snapshot on each turn instead of expecting it to carry forward automatically.",
"items": {
"$ref": "#/definitions/v2/EphemeralContext"
},
"type": [
"array",
"null"
]
},
"input": {
"items": {
"$ref": "#/definitions/v2/UserInput"
@@ -90,6 +90,23 @@
],
"type": "object"
},
"EphemeralContext": {
"properties": {
"text": {
"description": "Free-form text payload for additional context sent with one turn.",
"type": "string"
},
"title": {
"description": "Human-readable title for additional context sent with one turn.",
"type": "string"
}
},
"required": [
"text",
"title"
],
"type": "object"
},
"ModeKind": {
"description": "Initial collaboration mode to use when the TUI starts.",
"enum": [
@@ -520,6 +537,16 @@
],
"description": "Override the reasoning effort for this turn and subsequent turns."
},
"ephemeralContext": {
"description": "Additional model-visible context for this turn, such as editor or IDE state. This context is not re-injected automatically after compaction, so clients should send a fresh snapshot on each turn instead of expecting it to carry forward automatically.",
"items": {
"$ref": "#/definitions/EphemeralContext"
},
"type": [
"array",
"null"
]
},
"input": {
"items": {
"$ref": "#/definitions/UserInput"
@@ -0,0 +1,13 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type EphemeralContext = {
/**
* Human-readable title for additional context sent with one turn.
*/
title: string,
/**
* Free-form text payload for additional context sent with one turn.
*/
text: string, };
@@ -8,10 +8,17 @@ import type { ReasoningSummary } from "../ReasoningSummary";
import type { ServiceTier } from "../ServiceTier";
import type { JsonValue } from "../serde_json/JsonValue";
import type { AskForApproval } from "./AskForApproval";
import type { EphemeralContext } from "./EphemeralContext";
import type { SandboxPolicy } from "./SandboxPolicy";
import type { UserInput } from "./UserInput";
export type TurnStartParams = {threadId: string, input: Array<UserInput>, /**
* Additional model-visible context for this turn, such as editor or IDE state.
* This context is not re-injected automatically after compaction, so
* clients should send a fresh snapshot on each turn instead of expecting
* it to carry forward automatically.
*/
ephemeralContext?: Array<EphemeralContext> | null, /**
* Override the working directory for this turn and subsequent turns.
*/
cwd?: string | null, /**
@@ -76,6 +76,7 @@ export type { DynamicToolCallParams } from "./DynamicToolCallParams";
export type { DynamicToolCallResponse } from "./DynamicToolCallResponse";
export type { DynamicToolCallStatus } from "./DynamicToolCallStatus";
export type { DynamicToolSpec } from "./DynamicToolSpec";
export type { EphemeralContext } from "./EphemeralContext";
export type { ErrorNotification } from "./ErrorNotification";
export type { ExecPolicyAmendment } from "./ExecPolicyAmendment";
export type { ExperimentalFeature } from "./ExperimentalFeature";