chore(release): add changeset for #2529 IAgenticAdapter PRs#2534
Closed
williamzujkowski wants to merge 3 commits into
Closed
chore(release): add changeset for #2529 IAgenticAdapter PRs#2534williamzujkowski wants to merge 3 commits into
williamzujkowski wants to merge 3 commits into
Conversation
AgenticAdapter now picks behaviour from the resolved model identity,
not from IModelAdapter.providerId. For a custom OpenAI gateway
fronting Claude/Llama/Qwen/etc, the loop adapts to the actually-served
model — parallel tool execution where the model supports it, prompt-
caching opt-in for Anthropic, embedding models refused at construction.
## Constructor changes (additive)
- modelHints: ModelHints — operator override of identity. Each field
optional; provided fields force, others fall through to probe/parse.
- skipProbe: boolean — opt out of the /v1/models probe at first
runAgent.
- forceProfile: ModelBehaviorProfile — bypass identity-driven lookup
entirely; reserved for tests and diagnostic runs.
## Identity resolution flow
1. Constructor: sync resolve from modelId + hints. Stamps initial
profile + adapterStrategy. Fast, no network.
2. First runAgent: ensureIdentityResolved() runs the async probe
when listModels is available. Upgrades profile + strategy if the
probe contributes a higher-confidence vendor signal. Memoised.
3. Subsequent runAgent: cached profile reused. No re-probe.
adapterStrategy now reads native:<resolved-vendor> for known vendors,
wrapper for unknown — sourced from modelId parse + probe, not from
providerId. Gateway scenario gets the right answer.
## Behaviour driven by profile
- parallelToolCalls=true: when the model emits >1 tool_use in one
assistant turn, run them via Promise.all. Anthropic claude-4.x +
OpenAI gpt-4o families opt in. Open-weight families stay sequential.
- quirks.includes('embedding'): constructor throws AgentError.
Parallel execution preserves trace ordering: turns[] ordered by
toolUse emission, not completion order. A tool error in any parallel
slot stops the loop with stopReason='tool-error'.
## Tests (9 new, 23 total)
- Refuses to construct embedding models
- Exposes getProfile / getResolvedIdentity accessors
- Strategy stamp follows resolved vendor (gateway scenario)
- modelHints override + forceProfile bypass
- Parallel: ≥3 tool calls run with maxInFlight ≥2
- Parallel: ordering preserved despite reverse completion
- Parallel: tool error in any slot returns stopReason='tool-error'
Also tightens model-identity.ts merge so version is computed once.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two small refinements that finish the AgenticAdapter profile-driven behaviour story. ## 1. turnBudget defaults to profile.maxRecommendedTurnBudget Previously turnBudget was required in RunAgentArgs. Now it's optional; when omitted, the adapter uses the resolved profile's recommendation: - claude-opus / o-reasoning: 20-25 (deep reasoning loops) - claude-sonnet / openai-default / google-default: 15 - claude-haiku / gemini-flash: 8 (fast models, less iteration) - meta / qwen / nvidia / mistral / cohere: 8 (open-weight) - default / unknown: 10 Callers can still pass an explicit turnBudget; profile budget is purely the default. Internal LoopState reads from a ResolvedRunAgentArgs type that requires turnBudget, so the helper signatures stay strict. ## 2. cache_control: ephemeral marker on the LAST tool definition When profile.promptCaching === 'ephemeral' (Anthropic vendors), the adapter marks the last ToolDefinition with cacheControl: ephemeral. Anthropic interprets this as "cache everything up to and including the tool definitions" — a major cost win for multi-instance eval harnesses running with the same toolset across hundreds of runs. Last-tool placement is the Anthropic convention: cache key is the prefix, so caching the final tool block caches the entire tools section. System prompt + user prompt + tools are stable per-turn, so cache-hit rate is high. Other providers (OpenAI / Google / etc) ignore the unknown cacheControl field at the canonical-request mapper — harmless. ## Tests (4 new, 27 total) - turnBudget defaults to profile (claude-haiku → 8 turns then turn-budget stop) - explicit turnBudget overrides default (claude-haiku + budget=2 → 2 turns) - ephemeral marker added to LAST tool def for anthropic models - no marker added when profile.promptCaching === 'none' (gpt-4o) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Retroactive changeset for the four PRs that landed the IAgenticAdapter primitive + dynamic model-identity / behaviour-profile system. Bumps nexus-agents minor — net effect is additive public API + behaviour extension, no breakage. Picked up by the open changesets release PR (#2401) so the next release publishes IAgenticAdapter for eval-repo v0.3 consumers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded — will fold the changeset into the new PR C branch. |
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.
Retroactive changeset for #2530/#2531/#2532/#2533. Bumps minor; additive only. Picked up by the changesets release PR (#2401).