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

@@ -1,2 +1,2 @@
c1446005a26262d6b817d72493471d11c618b98441fad2014f1cf422bfe64bc9 plugin-sdk-api-baseline.json
1b7d71eaabcae7d957396e7ff242598ef22b51851bc3fe1f4b58f2c2e5bf1459 plugin-sdk-api-baseline.jsonl
37787172adf7a55a32097599b4bf5729fc7138c8743c6f4c9d58fc8d01df72a1 plugin-sdk-api-baseline.json
0ec4957528477832085c638a5f7f691c878ba199f3e81f330f162c27cfd9ebf4 plugin-sdk-api-baseline.jsonl

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