fabro/lib/components/fabro-agent/src
Bryan Helmkamp d669a2d55c
fix(agent): correct background-agent notification delivery
Three correctness fixes in the Claude 5 background-agent path, plus
cleanups from a reuse/quality/efficiency review pass.

Fixes:

- Background-agent output was run through skill expansion. A child that
  wrote a bare path ("cleaned up /tmp") failed the whole parent turn with
  `Unknown skill: /tmp`, and a child whose output happened to name a real
  skill had its report replaced by that skill's template. Synthesized
  harness turns now skip expansion; only text the user typed can invoke a
  skill.

- `begin_shutdown` suppressed the pending notification before deciding
  whether a shutdown would happen. Stopping an agent that had just
  finished rejected the stop *and* discarded the result the parent was
  owed. Suppression now happens only once shutdown is committed.

- `spawn_inner` registered the notification after publishing the agent in
  `state.agents`, so a concurrent `shutdown_all` in that window left a
  pending entry the monitor never completes, and the parent's drain loop
  would never see the queue as drained. Registration now precedes
  publication.

- `TaskOutput.timeout` was declared `number` but parsed with `as_u64`, so
  a schema-valid `30000.0` failed at runtime.

- Update the fabro-server alias test for the `sonnet` alias moving to
  Claude Sonnet 5.

Cleanups:

- The supervisor renders the notification turn; `Session` no longer knows
  the envelope format.
- Replace six near-identical prompt snapshots with a property test over
  all eight conditional combinations, keeping the default and
  all-conditionals snapshots for wording.
- Collapse `TodoRuntime`'s two mutexes into one.
- Read the prompt vocabulary from the registry instead of hardcoding it.
- Drop internal vocabulary from the `SendMessage` tool description.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 15:15:39 -04:00
..
profiles fix(agent): correct background-agent notification delivery 2026-07-25 15:15:39 -04:00
agent_profile.rs fix(agent): harden compaction reasoning budgets 2026-07-24 21:58:23 -04:00
apply_patch.lark refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
apply_patch.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
cli.rs fix(agent): simplify GPT-5.6 tool routing 2026-07-25 11:49:40 -04:00
compaction.rs fix(agent): align summary prompt with output cap 2026-07-24 22:21:52 -04:00
config.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
context_window.rs fix(agent): harden Kimi profile tool contracts 2026-07-24 22:05:48 -04:00
docker_sandbox.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
error.rs fix(agent): harden compaction failure handling 2026-07-24 20:57:57 -04:00
event.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
file_tracker.rs fix(agent): harden Kimi profile tool contracts 2026-07-24 22:05:48 -04:00
history.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
lib.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
local_sandbox.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
loop_detection.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
mcp_integration.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
memory.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
native_tool.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
question_tools.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
read_before_write_sandbox.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
sandbox.rs refactor(glob): unify workspace path matching 2026-07-25 10:30:19 -04:00
session.rs fix(agent): correct background-agent notification delivery 2026-07-25 15:15:39 -04:00
skills.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
subagent.rs fix(agent): correct background-agent notification delivery 2026-07-25 15:15:39 -04:00
task_reminder.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
test_support.rs fix(agent): harden Kimi profile tool contracts 2026-07-24 22:05:48 -04:00
todo_runtime.rs fix(agent): correct background-agent notification delivery 2026-07-25 15:15:39 -04:00
todo_tools.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
tool_execution.rs fix(agent): report real shell process outcomes 2026-07-24 21:24:16 -04:00
tool_permissions.rs refactor(agent): model built-in tools as an enum with per-profile vocabularies 2026-07-24 20:04:11 -04:00
tool_registry.rs fix(agent): simplify GPT-5.6 tool routing 2026-07-25 11:49:40 -04:00
tools.rs feat(agent): add Claude 5 profile 2026-07-25 13:15:57 -04:00
truncation.rs fix(agent): harden Kimi profile tool contracts 2026-07-24 22:05:48 -04:00
types.rs Merge origin/main into feat/inference-observability 2026-07-24 22:55:15 -04:00