Clean eval errors, MCP prompts, visible worker output#15
Merged
Conversation
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>
aaa2722 to
bc232f3
Compare
Merged
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.
Three first-class-REPL improvements surfaced while dogfooding. Stacked on #14 (the Revise fix) since it touches
worker.jltoo — base retargets tomainonce #14 merges.1. Clean eval errors
include_stringwrapped errors inLoadErrorand the backtrace tail was AgentREPL/Malt scaffolding (include_string@loading.jl,src/worker.jl,eval@boot.jl, the Malt handler). Now:LoadError, so the message is the real exception.strip_harness_framesdrops the harness tail — the firstinclude_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 existingmax_stackframestruncation.sqrt(-1)now readsDomainError with -1.0: …+throw_complex_domainerror → sqrt → sqrt(Int64) → top-level @ julia_eval— no harness frames. A bareUndefVarErroris 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.PromptCapabilityis now declared.3. Visible out-of-band worker output (progress, part 1)
SessionStategains arecent_outputring; 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/logsurfaces it even when audit logging is off. (Spec-correct MCPnotifications/progressis the follow-up fork work.)Tests
strip_harness_frames+ end-to-end clean-error;prompts/list+prompts/getarg-substitution E2E (capabilities now includeprompts);recent_outputunit + async-capture. 318 unit / 379 withAGENTREPL_E2E=true, all green.🤖 Generated with Claude Code