Repository navigation
Own the unknown-model context assumption and adopt agent-core alpha.3 - #254
Merged
Merged
Conversation
@qduc/agent-core 0.2.0-alpha.3 no longer holds a default window for uncatalogued models; its planner schedules automatic compaction from the host's Model.contextWindow. Term2 now owns its 500,000-token figure (UNKNOWN_MODEL_CONTEXT_WINDOW in src/model/provider.ts) and keeps supplying it as Model.contextWindow, so behaviour for uncatalogued models is unchanged. alpha.3 also contains the cache usage and context-price tier accounting that the alpha.2 pnpm patch carried, so the patch and its patchedDependencies entry are removed and the pin moves to the release. src/model/index.ts loses its only runtime export (an unused ModelFailure re-export that was reached only through the removed constant import) and is now a type-only surface; runtime code already takes ModelFailure from src/model/failure.ts. Docs: the release reference records why the patch is retired, the model README says Term2 owns the number, and AGENTS.md no longer claims the core is vendored as a tarball. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JqbJBBoCXgqyyFZaYn5Co4
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.
Why
Term2 pinned
@qduc/agent-core@0.2.0-alpha.2with a pnpm patch carrying two things not yet released: the core's unknown-model scheduling assumption raised to 500,000 tokens, and the cache-usage / context-price-tier accounting. The 500,000 figure is Term2's policy, so the core owner removed the core's default instead of adopting Term2's number (qduc/agent-runtime#10, #11).0.2.0-alpha.3is now published: its planner schedules automatic compaction for an uncatalogued model from the host'sModel.contextWindow, it exports noDEFAULT_ASSUMED_CONTEXT_WINDOW, and it includes the accounting changes (#8).What changed
src/model/provider.ts: Term2 defines its ownUNKNOWN_MODEL_CONTEXT_WINDOW = 500_000(commented as Term2's scheduling assumption for models it cannot size) and uses it in the unknown-window warning and incontextWindow: catalogContextWindow ?? …. Uncatalogued models still get a 500,000-tokenModel.contextWindowand nocatalogContextWindow, as before.src/model/index.ts: dropped theDEFAULT_ASSUMED_CONTEXT_WINDOWre-export. That made the file's last runtime export, an unusedModelFailurere-export, unreachable andcheck-reachabilityfailed. No production or test code importsModelFailurefrom this file (runtime code takes it fromsrc/model/failure.ts), so I removed the dead re-export and the file is now a type-only surface, which the gate treats as erased. No allowlist entry was added.package.jsonpins@qduc/agent-core0.2.0-alpha.3;patches/@qduc__agent-core@0.2.0-alpha.2.patchand itspatchedDependenciesentry are deleted; theminimumReleaseAgeExcludeentry moves from alpha.2 to alpha.3 (alpha.3 was published minutes before).pnpm-lock.yamlregenerated bypnpm install; it has no patch hash for agent-core.docs/reference/release-agent-core.mdsections become "Retired unknown-model context patch" / "Retired cache accounting bridge" with the reason;src/model/README.mdsays Term2 owns the number and passes it asModel.contextWindow;AGENTS.mdno longer says the core is vendored asvendor/qduc-agent-core-*.tgz(there is no such tarball; the package is an exact-pinned npm prerelease).The wire package pin is untouched.
Verification
Revision: this branch's head, built on Node 24 / pnpm 11.7.0.
main's patch to a pristinenpm packof alpha.2 and randiff -ragainst alpha.3'sdist. The only differences are the fix(cost): treat invalid catalog rates as unpriced #11 changes (removed constant, newassumedContextWindowplanner input passed frommodel.contextWindow, and its validation). All accounting hunks (turn-budget.js,turn-model-compaction.js,model-cost.js,token-usage.d.ts,Usagefields) are identical.node_modules/@qduc/agent-core/package.jsonreports0.2.0-alpha.3.pnpm exec tsc -p tsconfig.build.json --noEmit,node scripts/check-layers.mjs,check-reachability.mjs(after thesrc/model/index.tsfix above),check-complexity.mjs,check-rules.mjs,check-engine-callbacks.mjs,check-baselines.mjs,pnpm exec node scripts/run-ci-lane.mjs quality(22 tests),pnpm typecheck,pnpm lint,pnpm build.pnpm exec node scripts/run-ci-lane.mjs provider-black-box: 48 files passed, 3 skipped (5 tests skipped by their own conditions; none in cost accounting).cache-cost.blackbox.ts("accounts for cache creation, whole-request context tiers and one-hour writes") passed.createProviderRegistrywith the installed, unpatched alpha.3: an uncatalogued OpenRouter model resolved withcontextWindow500,000, nocatalogContextWindow, and the warning "automatic compaction assumes 500,000 tokens". With the planner inputs that the core's compaction call site passes (catalogue capacity, andmodel.contextWindowas the assumption) and ratio 0.8, the planner returnednot_neededat 399,999 measured tokens and went on to a compaction attempt at 400,000.Not verified here
integration,testande2elanes were not run in full: in this container some of their cases fail on unmodifiedmainbecausebwrap/socatare missing and it runs as root. GitHub CI is the evidence for those lanes.Generated by Claude Code