Skip to content

feat(desktop): add /doctor diagnostics with non-blocking execution#5474

Open
XTLine wants to merge 6 commits into
esengine:main-v2from
XTLine:feat/gui-doctor-diagnostics
Open

feat(desktop): add /doctor diagnostics with non-blocking execution#5474
XTLine wants to merge 6 commits into
esengine:main-v2from
XTLine:feat/gui-doctor-diagnostics

Conversation

@XTLine

@XTLine XTLine commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Part of #2631
Closes #5473

Summary

  • Add /doctor runtime diagnostics command, surfaced across CLI, serve, and the desktop GUI
  • Diagnostics return immediately even while an agent turn is running — the command bypasses steer (bypassesSteerWhenRunning) so you can inspect state without interrupting or being blocked by long output
  • Thread the build version string through boot / CLI / serve so it shows in the diagnostics
  • Enhance NoticeCard to detect multi-line text and render it as a preformatted monospace block, preserving the column-aligned layout the backend produces; single-line notices keep their compact inline style
  • Add i18n entries (en / zh / zh-TW) and slash-command registration + tests

Verification

  • /doctor while idle → shows runtime, providers, plugins, lsp, sessions, sandbox, network, permissions in aligned columns (screenshot 2)
  • /doctor while an agent turn is running → returns diagnostics immediately, turn shows running, no need to cancel or wait (screenshot 3)
  • Single-line notices (/goal, /theme) still render inline without block styling
  • go test ./internal/control/... and pnpm test (incl. doctor-steer-bypass.test.ts) pass

Invoking /doctor:
doctor1

Output while idle:
doctor2

Output during a running turn (non-blocking):
doctor3

Cache impact

Cache-impact: none - boot.go only adds a Version string field plumbed through to diagnostic output (DoctorText); the assembled system prompt, tools, and cache keys are unchanged.
Cache-guard: existing boot/system-prompt golden tests cover this; the Version field never enters the prompt sent to the model, only /doctor display output.
System-prompt-review: Confirmed no system-prompt change — boot.go adds only a diagnostics Version field; @esengine please confirm.

XTLine added 3 commits June 28, 2026 10:27
Add Controller.DoctorText with runtime and doctor report output, wire /doctor through managementNotice, expose Desktop Doctor(tabID), and register the builtin command.

Thread binary version through boot/controller construction across CLI, Desktop, ACP, serve, and bot paths so doctor reports include the real version.

Add regression coverage for /doctor routing and non-blocking diagnostics while a turn is running.
Route /doctor before the running-turn steer path so diagnostics are available while a turn is running or stuck.

Add a small command-routing predicate, frontend regression test, and browser bridge mock output for local development.
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) labels Jun 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f6fa1fd30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/control/slash.go
Comment thread internal/control/doctor.go Outdated
Comment thread internal/control/doctor.go Outdated
XTLine added 3 commits June 28, 2026 14:16
- Add /doctor to CLI TUI (runSlashCommand, completion, help)
- Make doctor.Collect workspace-scoped: pass WorkingDir/SessionDir instead of relying on global os.Getwd()/config.SessionDir()
- Surface config.LoadForRoot error instead of silently dropping it
- Redact MCP failure error messages to prevent credential leaks (auth headers, tokens, passwords)
- Add redactMCPError test covering common leak patterns and truncation
- Update completion test to reflect /doctor in fuzzy filter results
- Resolved package.json test script conflict
- Included both approval-modal-file-reference.test.tsx and doctor-steer-bypass.test.ts
解决与main-v2的冲突,合并Memory v5改进相关代码
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add /doctor diagnostics that work during agent execution

1 participant