Fix agent launcher chat window and hermes grounding#534
Merged
Conversation
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
marked this pull request as ready for review
July 14, 2026 07:27
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.
Problem
Launched agents (opencode, hermes) failed in ways that looked like the model's fault but were the launcher's:
Solution