Skip to content

Clean eval errors, MCP prompts, visible worker output#15

Merged
samtalki merged 1 commit into
mainfrom
feat/clean-errors-prompts-progress
Jun 7, 2026
Merged

Clean eval errors, MCP prompts, visible worker output#15
samtalki merged 1 commit into
mainfrom
feat/clean-errors-prompts-progress

Conversation

@samtalki

@samtalki samtalki commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Three first-class-REPL improvements surfaced while dogfooding. Stacked on #14 (the Revise fix) since it touches worker.jl too — base retargets to main once #14 merges.

1. Clean eval errors

include_string wrapped errors in LoadError and the backtrace tail was AgentREPL/Malt scaffolding (include_string@loading.jl, src/worker.jl, eval@boot.jl, the Malt handler). Now:

  • The worker (and the attach REPL) unwrap the LoadError, so the message is the real exception.
  • strip_harness_frames drops the harness tail — the first include_string/boot-eval(m::Module, e::Any) frame and everything below it — keeping only the user's frames (a bare top-level error becomes message-only). Runs before the existing max_stackframes truncation.

sqrt(-1) now reads DomainError with -1.0: … + throw_complex_domainerror → sqrt → sqrt(Int64) → top-level @ julia_eval — no harness frames. A bare UndefVarError is just the message.

2. MCP prompts

julia-dev-setup, julia-benchmark, julia-debug-error — static templates with {arg}/{?arg?…} substitution, surfaced as slash commands. They ship with the server, so they work without the plugin. PromptCapability is now declared.

3. Visible out-of-band worker output (progress, part 1)

SessionState gains a recent_output ring; the output drain tees worker lines that land outside an eval's capture window (spawn-time precompile, async prints) to it and to the live log viewer — never the stdout transport. agentrepl://session/log surfaces it even when audit logging is off. (Spec-correct MCP notifications/progress is the follow-up fork work.)

Tests

strip_harness_frames + end-to-end clean-error; prompts/list + prompts/get arg-substitution E2E (capabilities now include prompts); recent_output unit + async-capture. 318 unit / 379 with AGENTREPL_E2E=true, all green.

🤖 Generated with Claude Code

Three first-class-REPL improvements (target main; stacked on the Revise fix #14).

Clean stacktraces:
- Unwrap include_string's LoadError on the worker (worker.jl) and in the attach
  socket REPL (attach.jl), so the message is the real exception, not "LoadError: …".
- formatting.jl strip_harness_frames: drop the harness tail (the first
  include_string / boot `eval(m::Module, e::Any)` frame and everything below it —
  worker.jl, the Malt handler), keeping only the user's frames; a bare top-level
  error becomes message-only. Runs before the existing max_stackframes truncation.
  An eval error now reads like a normal Julia REPL error.

MCP prompts (prompts.jl):
- julia-dev-setup, julia-benchmark, julia-debug-error — static MCPPrompt templates
  with {arg}/{?arg?…} substitution. Surface as slash commands; work without the
  plugin. Registered in server.jl with PromptCapability.

Visible out-of-band output (W3a of the progress work):
- SessionState gains a recent_output ring; _start_output_drain! tees drained worker
  lines (spawn-time precompile, async prints) to it and to the live log viewer, in
  addition to the server's stderr — never the stdout transport.
- agentrepl://session/log surfaces recent_output even when audit logging is off.

Tests: strip_harness_frames + end-to-end clean-error tests; prompts/list + get
(arg substitution) E2E and capabilities now include prompts; recent_output unit +
async-capture tests. 318 unit / 379 with AGENTREPL_E2E=true.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@samtalki samtalki force-pushed the feat/clean-errors-prompts-progress branch from aaa2722 to bc232f3 Compare June 7, 2026 05:59
@samtalki samtalki deleted the branch main June 7, 2026 17:36
@samtalki samtalki closed this Jun 7, 2026
@samtalki samtalki reopened this Jun 7, 2026
@samtalki samtalki changed the base branch from fix/revise-load-order to main June 7, 2026 17:37
@samtalki samtalki merged commit 198c994 into main Jun 7, 2026
10 checks passed
@samtalki samtalki deleted the feat/clean-errors-prompts-progress branch June 7, 2026 17:45
@samtalki samtalki restored the feat/clean-errors-prompts-progress branch June 7, 2026 17:46
@samtalki samtalki deleted the feat/clean-errors-prompts-progress branch June 7, 2026 17:46
@samtalki samtalki mentioned this pull request Jun 7, 2026
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