Repository navigation
Console: 503 with why instead of a bare 502 - #73
Merged
Merged
Conversation
When the agent's console doesn't answer, Console.forward now says why and what
to do: an agent running without its console (started without --serve), the
agent off, a named agent or console URL that doesn't answer, no agent binary,
or an agent that didn't start (its agent.log). A browser gets a small page in
the console's look that reloads itself every 2 s; API calls and files get
{"error": ...}; both with Retry-After. Spring, Micronaut and Ktor pass the
Accept header.
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.
Console.forwardanswered502 "Tracepanel's agent doesn't answer."when the console atconsole.addrdidn't answer after a restart, and a terse 503 when there was no console address. Now every such answer is a 503 withRetry-After: 2that says what's wrong and what to do (Agent.noConsole(), same wording as the JS and Python SDKs):agent.addrbut serves no console (started without--serve; console.addr missing or left over) → stop it, the next request starts one with its console; names the storeTRACEPANEL_AGENT=off; a named agent orTRACEPANEL_CONSOLE_URLthat doesn't answerTRACEPANEL_AGENT_BINnaming nothing, or none found/downloaded)agent.logA browser navigation (Accept: text/html) gets a small self-contained page in the console's dark look that reloads itself every 2 s, so it turns into the console once it answers (also in the widget's panel iframe); everything else gets
{"error": "..."}. Spring, Micronaut and Ktor pass the request's Accept header (newConsole.forwardoverload; the old one stays).Tests:
ConsoleUnavailableTest(agent without console, with and without a stale console.addr; off; missing binary; agent that fails to start; page escaping and no external assets)../gradlew checkpasses.🤖 Generated with Claude Code