Repository navigation
fix(platform): give agents on Pi the model's context window - #5416
Merged
Merged
Conversation
Tale staged Pi's model with its id alone, so Pi took 128,000 tokens for
every model it reached through the gateway. Pi caps each request's
output at that window minus its estimate of the conversation, one token
at least, and compacts only near it: once a conversation of a larger
model passed about 124,000 estimated tokens, every answer was one token
long (stop reason `length`), the run ended without a report
(`empty_turn`), and its retry, which resumes the same conversation,
ended the same way.
Pi's models.json entry now carries the run's window, the catalog's
narrowed by the organization's context limit, as `contextWindow`. A
`set` fragment takes a number from the build as a number template,
`{ $number: '${model.contextWindow}' }`: the whole number its template
resolves to, and its key (or array slot) left out when that is empty,
so an unknown window keeps Pi's own default. Any other text is refused
without being repeated, and `$number` is no longer a key a `set` tree
may use.
The docs say that Pi follows the window, and a context limit, at any
size.
Contributor
Author
|
Release lease released: v0.5.105 is published
Receipt (RELEASING.md, "A release that has to go out", step 4):
Holds, read again before the tag at 23:09 UTC: only the lease comment on the hub's Decide task; no comment or open issue names a hold. Other checks:
A published version is not a deployment elsewhere; Ops adopts it with its release adopter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Tale staged Pi's model with its id alone, so Pi took 128,000 tokens for every model it reached through the gateway. Pi caps each request's output at that window minus its estimate of the conversation (one token at least) and compacts only near it. Once a conversation of a larger model passed about 124,000 estimated tokens, every request asked for one token: the model stopped with
lengthafter one token, the run ended withempty_turn("the agent ended its turn without a final report"), and the retry, which resumes the same Pi session, failed the same way at once.Seen on a production deployment running 0.5.104 with agents on Pi (models of 196,608 tokens): a standing triage role, whose runs continue one conversation, failed twice at 115,854 input tokens with
stopReason: length, output: 1, and a long Coder run failed after 50 minutes, then three times more on resume.The change
harness.ymlfor Pi now stagescontextWindowbeside the model id: the window${model.contextWindow}already gives Claude Code, the catalog's narrowed by the organization's context limit. Unlike Claude Code's, there is nobelowgate: Pi knows no model it reaches through Tale, so any resolved window is better than its 128,000.settree could only substitute strings, and Pi's schema takes a number.{ $number: '<template>' }now stands for the whole number its template resolves to. When the template resolves to nothing (an unknown window), its key or array slot is left out, so the CLI keeps its own default. Any other text is a config defect, refused without repeating it.$numbercan no longer be a key of asettree. No shipped harness used one.Testing
lib/harnesses: 358 tests. New: number templates resolve, are left out when empty (key and array slot), and refuse other text without echoing it. Pi's model gets the catalog window, and none when it is unknown. Pi's goldenmanaged-model-context-windowis refrozen with"contextWindow":32768. Pi left the "builds the same execs whatever the window" group.packages/sharedproviders.test.ts: 104 tests. New: the schema reads a number template and refuses$numberas a key, beside other keys, or as a non-text value.tsc --noEmitforpackages/sharedandservices/platform, type-awareoxlint,oxfmt --check,lint:links, the docs locale guards, andrelease-notes.ts --version v0.5.105(no migration, API contract unchanged at 3.53.0).