Skip to content

Fix agent launcher chat window and hermes grounding#534

Merged
tobocop2 merged 3 commits into
mainfrom
fix/agent-coding-bugs
Jul 14, 2026
Merged

Fix agent launcher chat window and hermes grounding#534
tobocop2 merged 3 commits into
mainfrom
fix/agent-coding-bugs

Conversation

@tobocop2

@tobocop2 tobocop2 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Problem

Launched agents (opencode, hermes) failed in ways that looked like the model's fault but were the launcher's:

  • The served chat window was sized from host RAM and capped low (16384 to 24576), so an agent's large baseline prompt (system prompt, tool schemas) plus reserved output overflowed on the first turn, even with headroom to spare.
  • hermes launched without grounding: the launcher ignored whether lilbee_search connected over hermes's optional MCP extra, so hermes ran to exit 0 without ever calling it, answering from its own training instead of the indexed docs.

Solution

  • Raise the served-context target to an agent-sized floor before the server starts. The picker still clamps to the model's trained window and host memory, so it never over-allocates and a smaller configured target or explicit pin is preserved.
  • Use the MCP setup result: warn clearly when hermes will run ungrounded, and surface why an auto-install failed (a pip-less or externally-managed environment) instead of swallowing it.

tobocop2 added 2 commits July 14, 2026 01:30
Agent clients (opencode, hermes) open with a large baseline prompt -- system
prompt, AGENTS.md, and tool schemas including lilbee_search -- and reserve
output tokens from the window. The default chat context is picked from host RAM
and tops out at 24576, which leaves too little input budget, so the first turn
overflows before the agent does any work; lilbee_search returning a full class
XML can push even 32768 over, and hermes refuses a window under 64000 outright.

Raise the served-context target to a 65536 agent floor whenever a client is
launched: set it in-process so the warm wait and the small-window warning use
the same target, and pass it to the spawned 'lilbee serve' via its environment
so the served window actually grows. The n_ctx picker still clamps to the
model's trained context and the host's VRAM, so this never over-allocates, and
the existing warnings fire when the floor cannot be met.
The hermes launcher wires lilbee in as a provider, installs the guidance skill,
and calls ensure_hermes_http_mcp to connect lilbee_search over HTTP MCP -- but
it discarded that call's result. When hermes's mcp extra could not be installed
or connected, hermes still launched and ran to exit 0 without ever calling
lilbee_search: ungrounded, answering from its own training instead of the served
docs, with only a one-line install hint buried in the output. A run looked wired
up while producing outdated, wrong answers.

Consume the result: when MCP was requested but did not connect, print a clear
warning that hermes will run without grounding. Also surface why an auto-install
did not take (a pip-less uv/pipx tool environment or an externally-managed
environment are the common causes) instead of swallowing pip's output, so the
operator can fix the environment and get grounding rather than guessing.
@tobocop2 tobocop2 changed the title Serve a larger chat window for launched agents Fix agent launcher chat window and hermes grounding Jul 14, 2026
@tobocop2
tobocop2 marked this pull request as ready for review July 14, 2026 07:27
@tobocop2
tobocop2 changed the base branch from fix/hybrid-ann-recall to main July 14, 2026 12:28
@tobocop2
tobocop2 merged commit c5b289a into main Jul 14, 2026
14 of 17 checks passed
@tobocop2
tobocop2 deleted the fix/agent-coding-bugs branch July 14, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant