Skip to content

fix(session): propagate error when subagent produces no text output - #22

Open
jfenal wants to merge 8 commits into
bobbyjohnstx:mainfrom
jfenal:fix/subagent-empty
Open

jfenal wants to merge 8 commits into
bobbyjohnstx:mainfrom
jfenal:fix/subagent-empty

Conversation

@jfenal

@jfenal jfenal commented Oct 9, 2026 •

Copy link
Copy Markdown

Summary

  • fix(session): Subagent returns empty string when model doesn't support tools (e.g. HTTP 400 from Ollama). Propagates the error so the parent model sees a meaningful failure instead of a blank tool result. Fixes fix(session): subagent returns silent empty string when no text output produced #21
  • fix(tui): Split OSC rgb color response tail (`b:0000/0000/0000`, `gb/0000:0000:0000`, `:0000/0000/0000`) leaks into the textarea. Added `oscRGBTail` regex matching the full split-suffix family with exactly 4 hex digits per channel (avoids false-positives on user input like `/exit`). Fixes fix(tui): split OSC color response leaks into textarea as "b:0000/0000/0000" #24
  • fix(provider): `shouldPoll()` ignored its `providerID` argument entirely, so `disabled_providers` config had no effect at the poll level — disabled providers still made HTTP connection attempts every 30s. Wired to `registry.isFiltered()`.

Test plan

  • `go test ./...` passes
  • Restart with a model that doesn't support tools → subagent error is now descriptive
  • Add `"disabled_providers": ["lm-studio"]` to config → no more polling in logs
  • Type `/exit` in prompt → autocomplete still appears (no false-positive filtering)

🤖 Generated with Claude Code

jfenal and others added 3 commits October 8, 2026 23:04
The go directive was set to 1.27.1, which exceeds what Fedora 44
ships (go1.26.8). Lower it to the actual minimum the dependency graph
requires (1.25.0, driven by a transitive dep found by go mod tidy),
so the project builds out of the box with the system Go on Fedora 44
without any manual toolchain installation.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Spec for a toggleable right-side TUI panel showing the live LLM
stream transcript (text deltas, tool calls, reasoning, step
boundaries). No server-side changes required — reuses existing
SSE event flow.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
When a subagent uses a model that doesn't support tools (e.g. HTTP 400
from Ollama), the iteration limit fires with result.Error set but
result.Messages non-empty (the user prompt is stored). The empty-check
at len(result.Messages)==0 was skipped, returning ("", nil) silently.

The parent model then saw an empty tool result and generated its own
confusing "The subagent came back empty" message.

Fix: after extracting assistant text, check response == "". When empty
with an error, propagate it so the task tool returns IsError=true with
the real cause. When empty without an error, return a diagnostic string
so the parent model can reason accurately.

Fixes bobbyjohnstx#21

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jfenal
jfenal requested a review from bobbyjohnstx as a code owner October 9, 2026 16:53
jfenal and others added 5 commits October 9, 2026 19:03
Terminal color query responses arrive as e.g. "\033]10;rgb:0000/0000/0000\007".
When split across OS reads, the first fragment ("\033]10;rg") is caught by
the escape-byte check but the tail ("b:0000/0000/0000") slips through: it
contains no escape byte, no "rgb:" substring, and fails the hex-only
oscHexFragment regex.

Add oscRGBTail regex that matches the [rgb]{1,3}: prefix pattern so any
split suffix of an OSC color response is caught by isTerminalEscape.

Fixes bobbyjohnstx#24

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Some terminals use "rgb/R:G:B" instead of "rgb:R/G/B" — e.g. producing
"gb/0000:0000:0000" as a split-read tail. Widen oscRGBTail regex to
accept both : and / as the separator between the prefix and channels.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…00/0000)

Terminal splits response further — "rgb" fully consumed, leaving only
":0000/0000/0000". Allow zero prefix chars in oscRGBTail regex.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…se-positive

{1,4} hex matched "/e" in "/exit", filtering slash commands. Terminal
color responses always use full 16-bit channels (4 hex digits), so {4}
is both correct and safe.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
shouldPoll() ignored providerID entirely (_ = providerID; return true),
so disabled providers were still polled every 30s even when filtered out
via disabled_providers config. Wire it to registry.isFiltered() so
disabled providers are skipped at the poll level, not just at registration.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant