chore(deps): require amplifier-agent 0.17.0 - #28
Merged
Conversation
Below 0.17.0 the token counts this application puts in front of users are wrong. The engine's extract_usage() computed the OpenAI-wire usage.prompt_tokens as inputTokens + cacheReadTokens + cacheWriteTokens, on the premise that the three are disjoint buckets. They are not: per amplifier-core's PROVIDER_CONTRACT.md, inputTokens is the gross input total and already contains the cache reads, so the cached portion was counted twice. On a cache-heavy turn -- the normal case in an agent loop -- that roughly doubles the reported prompt. That figure arrives on /v1/chat/completions, the endpoint we drive for every turn, and opencode's TUI displays it. Nothing in this repo parses the usage block itself, which is why the bad number passed straight through. PROTOCOL_VERSION also moved (0.3.0 -> 0.4.0) in that release but does not gate this application: we drive the HTTP face only and never spawn through a wrapper SDK, so there is no stdio handshake here to fail. AGENT_PINNED_REF and AGENT_HARD_FLOOR follow MIN_AGENT_VERSION and now resolve to v0.17.0 and 0.17.0. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.
Moves the engine floor to the release cut in microsoft/amplifier-agent#158.
Why this floor moves
Below 0.17.0 the token counts this application puts in front of users are wrong.
The engine's
extract_usage()computed the OpenAI-wireusage.prompt_tokensasinputTokens + cacheReadTokens + cacheWriteTokens, on the premise that the three are disjoint buckets. They are not: per amplifier-core'sPROVIDER_CONTRACT.md,inputTokensis the gross input total and already contains the cache reads, so the cached portion was counted twice. On a cache-heavy turn — the normal case in an agent loop — that roughly doubles the reported prompt.That figure arrives on
/v1/chat/completions, the endpoint we drive for every turn, and opencode's TUI displays it. Nothing in this repo parses theusageblock itself, which is exactly why the bad number passed straight through to the user rather than being caught here.This is a correctness bump, not an adoption bump. It is a stronger rationale than the last two floor moves, which the comment block records as adoption bumps taken to keep
AGENT_PINNED_REFfrom drifting a release behind.What does not force it
PROTOCOL_VERSIONmoved0.3.0->0.4.0in 0.17.0, which looks like the obvious trigger and is not one. This application drives the HTTP face only —serve,/v1/models,/v1/chat/completions,/v1/skills,/v1/modes— and never spawns through a wrapper SDK, so there is no stdio handshake here to fail. The comment block says so explicitly, so the next person reading it does not re-derive the wrong reason.The engine's other 0.17.0 changes (
--prompt-file, real per-turn usage on therunenvelope, the wrapper SDKUsagetype) are on surfaces this application does not use.Cost of the bump
A floor move forces every opencode user through a reinstall at next launch, via the silent self-heal that targets
AGENT_PINNED_REF. That cost is the reason the comment block justifies each bump individually.Verification
make checkpasses (ruff lint + format, 56 files).Nothing in this repo asserts these constants —
tests/is e2e-only and needs a DTU, and the onboarding suite's fake agent reports99.0.0, comfortably above any real floor. So the check that matters is reading the constants back:v0.17.0is pushed and its GitHub Release exists, soAGENT_PINNED_REFresolves to a real tag: https://github.com/microsoft/amplifier-agent/releases/tag/v0.17.0🤖 Generated with Amplifier