You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capture console output, not just returned values (issue #27 follow-up)
ClaudeR 0.14.0. The task callback only ever sees the value a command
returns, so the log showed f() but not what f() printed. cat(), progress
output and print() inside a function were all missing, which is the
usual content of an error a user wants to hand to an agent.
Standard output is now teed to a scratch file with sink(split = TRUE),
so the console still shows everything, and drained per command by read
offset. Reopening the file mid-session corrupts the sink stack, so the
offset is tracked instead. Printed output is preferred over the returned
value when both exist.
Verified that an agent execute_r call, which pushes its own
capture.output on top of this sink, still captures its own output and
does not leak into the user attribution. Teardown pops the sink on stop
and on session exit via a finalizer, guarded by sink.number().
R CMD check: Status OK.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,8 @@ claudeAddin()
50
50
<details>
51
51
<summary><b>Recent Updates</b> (click to expand)</summary>
52
52
53
+
-**Console logging now captures output, not just results (R 0.14.0).** From follow-up on the logging request. The log recorded the value a command returned, so anything printed as a side effect was missing: `cat()`, progress output, and `print()` called inside a function. Running `f()` showed the call but not what `f()` printed, which is exactly the context an agent needs when you hand it an error you hit yourself. Standard output is now teed to the log and grouped under the command that produced it, alongside the warnings, messages, and errors already captured. Your console still shows everything as normal.
54
+
53
55
-**Windows session-liveness fix (R 0.13.2).** Checking whether a recorded R session was still alive used `tools::pskill(pid, signal = 0)`. That is the standard idiom on Unix, but on Windows `pskill` always calls `TerminateProcess` regardless of signal, so the check killed the session it was asking about, then reported it as alive and left the stale discovery file in place. Starting a server could therefore terminate another RStudio session and leave agents routed to a dead port. Liveness is now probed without signalling. Separately, registering a session whose name is already held by a different live session now warns instead of silently overwriting its discovery file, which had left agents holding the wrong port and token.
54
56
55
57
-**Unified console logging (R 0.13.0).** The session log recorded what the agent ran, but not what you ran, so asking an agent to explain an error you hit in the console meant re-running the work through it. Tick "Also log my own console commands" under Logging and your console activity joins the same file, tagged by who ran what: the command, its printed result, and any warnings, messages, or errors. "Read the last 100 lines of the log" is now enough for an agent to see both sides of the session. Off by default; toggle it in the addin or call `start_console_logging()` / `stop_console_logging()`.
0 commit comments