You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agents): make the sub-agent learning subsystem actually work (#80)
* fix(agents): make the sub-agent learning subsystem actually work
The Reflector → Skillbook → prompt-injection loop was fully built but
dead: the Reflector read `context.transcript` and `context.taskPrompt`,
neither of which the context manager ever set. Reflection threw on every
non-trivial run and the error was silently swallowed as "Learning failed",
so no skills were ever persisted or injected.
- context-manager: populate `context.taskPrompt` and an in-memory
`context.transcript`, kept in sync in `recordToolCall`.
- reflector: fix error-recovery detection (sliced by a ms timestamp instead
of the entry's index, always yielding []); make `_inferTaskType` null-safe
so reflection can never throw.
- executor/coordinator/index: thread the definition loader through so newly
learned skills re-inject into agent prompts live (not only after restart);
loader injection rebuilds from the original prompt, so it stays idempotent.
- loader: add periodic pruning of proven-unhelpful skills on a hardcoded
6h unref'd timer (only when agents are enabled).
- add test/agent-learning.test.js covering the full loop and pruning.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(orchestrator): report real model/usage on tool-call responses (#78)
toAnthropicResponse() built the response `model` from the client request
(falling back to a hardcoded default) and never looked at the provider's
actual model, so tool-call responses reported a stale/aliased model. Usage
also silently zeroed when the provider used input_tokens/output_tokens
naming, and the prompt-cache-hit path returned without _routingMeta so
downstream model-name resolution couldn't correct it.
- model: prefer openai.model, fall back to requestedModel (mirrors the
direct non-tool path `databricksResponse.json.model || requestedModel`).
- usage: accept both prompt_tokens/completion_tokens and
input_tokens/output_tokens shapes.
- attach _routingMeta on the cache-hit return path, matching the live loop.
- export toAnthropicResponse and add test/tool-call-response-metadata.test.js.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: vishal veerareddy <vishalveera.reddy@servicenow.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments