fix(context-engine): honor assembled prompt authority in precheck (#74255)

Merged via squash.

Prepared head SHA: 650b02380b
Co-authored-by: 100yenadmin <239388517+100yenadmin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
Andrew
2026-05-01 21:43:41 +07:00
committed by GitHub
parent 0ce0509856
commit 42584964ac
8 changed files with 177 additions and 5 deletions

View File

@@ -197,6 +197,17 @@ Required members:
<ParamField path="systemPromptAddition" type="string">
Prepended to the system prompt.
</ParamField>
<ParamField path="promptAuthority" type='"assembled" | "preassembly_may_overflow"'>
Controls which token estimate the runner uses for preemptive overflow
prechecks. Defaults to `"assembled"`, which means only the assembled
prompt's estimate is checked — appropriate for engines that return a
windowed, self-contained context. Set to `"preassembly_may_overflow"` only
when your assembled view can hide overflow risk in the underlying
transcript; the runner then takes the maximum of the assembled estimate
and the pre-assembly (unwindowed) session-history estimate when deciding
whether to preemptively compact. Either way, the messages you return are
still what the model sees — `promptAuthority` only affects the precheck.
</ParamField>
`compact` returns a `CompactResult`. When compaction rotates the active
transcript, `result.sessionId` and `result.sessionFile` identify the successor