Skip to content

Console: say why there is no console, for each case - #176

Merged
antonrh merged 1 commit into
mainfrom
console-proxy-503
Nov 20, 2026
Merged

antonrh merged 1 commit into
mainfrom
console-proxy-503

Conversation

@antonrh

@antonrh antonrh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The console under /__tracepanel__/ already answered 503 without an agent, but its reason (agent.unavailable()) knew only "off", "no binary" and "isn't running". An agent alive at agent.addr but serving no console (started by hand without --serve; console.addr missing or left over) was reported as "the agent isn't running".

Now agent.no_console() gives a title and a detail, in the same words as the JS and Java SDKs:

  • off (the agent setting, TRACEPANEL_AGENT=off)
  • a named agent: no console at console_url
  • the project's agent runs without its console → stop it, the next request starts one with its console; names the store
  • TRACEPANEL_AGENT_BIN naming nothing / no binary for this platform
  • the agent didn't start → its agent.log

A browser page (Accept: text/html, now passed by Django, ASGI and WSGI on Request.accept) gets a small self-contained page in the console's dark look that reloads itself every 2 s; everything else gets {"error": "<detail>"}. Both carry Retry-After: 2 and Cache-Control: no-store. unavailable() stays for the CLI and the pytest plugin.

Tests: tests/console/test_no_console.py (each case, the page's refresh and escaping); tests/django/test_widget.py updated. uv sync with all CI groups, poe lint and poe test pass (1469 passed).

🤖 Generated with Claude Code

The console's 503 named only the agent off, a missing binary or a stopped
agent. An agent running without its console (started without --serve), whose
console.addr is missing or left over, got "the agent isn't running". Now
agent.no_console() tells the cases apart in the words the JS and Java SDKs use
(off, a named agent's console, no console, no binary, didn't start with its
agent.log). A browser's page (Accept: text/html) gets a page in the console's
look that reloads itself every 2 s; the rest gets {"error": ...}; both with
Retry-After.
@codspeed

codspeed Bot commented Nov 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 19 untouched benchmarks


Comparing console-proxy-503 (85d887b) with main (c5d9b47)

Open in CodSpeed

@antonrh
antonrh merged commit 6855f2e into main Nov 20, 2026
11 checks passed
@antonrh
antonrh deleted the console-proxy-503 branch November 20, 2026 13:51
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