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
Copy file name to clipboardExpand all lines: doc/Index.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,37 @@ You can use IRB as a debugging console with `debug.gem` with these options:
93
93
94
94
To learn more about debugging with IRB, see [Debugging with IRB](#label-Debugging+with+IRB).
95
95
96
+
### Agent Mode (Experimental)
97
+
98
+
`binding.agent` starts a non-interactive IRB session designed for AI agents and scripts. Instead of opening a REPL, it exposes an IRB session over a Unix socket using a simple request/response protocol. It is available on platforms where Ruby supports Unix sockets.
99
+
100
+
The behavior depends on the `IRB_SOCK_PATH` environment variable:
101
+
102
+
-**Not set**: prints instructions explaining the workflow, then exits. This lets the agent discover the breakpoint and learn the protocol.
103
+
-**Set**: starts a Unix socket server at the given path. Each connection accepts one command, evaluates it, returns the result, and closes. The IRB session state persists across connections. Send `exit` to end the session and resume app execution.
@@ -681,7 +712,7 @@ This integration offers several benefits over `debug.gem`'s native console:
681
712
However, there are some limitations to be aware of:
682
713
683
714
1.`binding.irb` doesn't support `pre` and `do` arguments like [binding.break](https://github.com/ruby/debug#bindingbreak-method).
684
-
2.As IRB [doesn't currently support remote-connection](https://github.com/ruby/irb/issues/672), it can't be used with `debug.gem`'s remote debugging feature.
715
+
2.The regular `binding.irb` console does not support `debug.gem`'s remote debugging feature. For agent-oriented remote evaluation, use the separate `binding.agent` Unix-socket workflow.
685
716
3. Access to the previous return value via the underscore `_` is not supported.
0 commit comments