Repository navigation
Conversation
320733e to
a6736b1
Compare
renkun-ken
left a comment
There was a problem hiding this comment.
Both the terminal and headless adoption tests passed locally on macOS with arf 0.7.2. The Windows and Ubuntu CI logs also show both tests executed. The terminal test demonstrates that R can still use an object created through the editor after the agent closes.
Please update the setup guide so users can discover a terminal launched with default settings, and exercise the default silent-evaluation policy in the new test. I also left two smaller notes on test cleanup and Windows Arm64. Windows CI · Ubuntu CI
| ## Requirements and setup | ||
|
|
||
| Use **VS Code 1.101.0 or newer**. R Interactive supports Linux, macOS, and Windows. On Windows, [connecting to an existing arf session](#connect-to-an-existing-arf-session) is not yet supported. Existing R terminal workflows remain available. | ||
| Use **VS Code 1.101.0 or newer**. R Interactive supports Linux, macOS, and Windows, including [connecting to an existing arf session](#connect-to-an-existing-arf-session). Existing R terminal workflows remain available. |
There was a problem hiding this comment.
Enable IPC before opening the picker. The linked guide’s first step says to start arf “as usual”. With the pinned arf 0.7.2, I started a plain arf and arf ipc list returned no sessions. After I typed :ipc start at the same R prompt, its PID appeared. Please update step 1 to cover both :ipc start in an existing terminal and arf --with-ipc when launching a new one. This also lets users keep objects they already have in an open terminal. arf IPC guide
| arf, | ||
| [ | ||
| '--with-ipc', | ||
| '--ipc-eval-unrestricted', |
There was a problem hiding this comment.
Keep arf’s default silent-evaluation policy in this test. The fixture already permits visible editor submissions with :ipc send-policy allow. --ipc-eval-unrestricted additionally permits arbitrary silent evaluation, so a future change that sent bootstrap or cell code silently could pass here and fail against a normally configured terminal. I reran this test on macOS with only this argument removed. Adoption, execution, interrupt, Stop refusal, and terminal reuse all passed. Please drop the argument.
| connection?.close(); | ||
| await adopted?.close(); | ||
| } finally { | ||
| await terminal.closeQuiet(); |
There was a problem hiding this comment.
Let arf exit normally on the successful path. On macOS I matched the socket to the PID written by this fixture. After a passing run, closeQuiet() had ended the process, but its <pid>.sock and containing directory still existed outside the suite’s temporary directory. Sending await terminal.submit("q('no')") after the final prompt assertion and then await terminal.waitExit({ timeout: 5000 }) let arf remove both. The existing finally can still close the PTY when an assertion fails.
| } | ||
| this.skip(); | ||
| } | ||
| const { TuiTest } = await import('@microsoft/tui-test'); |
There was a problem hiding this comment.
Windows Arm64 test prerequisite (minor). The pinned package selects its DLL using Node’s process.arch and publishes only win32-x64-msvc for Windows. A contributor using native Arm64 Node can run the x64 arf.exe under emulation and get past arf --version, then fail at this import because the Arm64 PTY package is missing. Please document x64 Node as the prerequisite for this test on Windows, or skip just the PTY case on that unsupported architecture. The headless adoption test can still run.
a6736b1 to
bc33715
Compare
With discovery through the arf CLI and a Stop that never signals an adopted process, connecting to an existing arf session no longer has Unix-only parts, so the documentation stops excluding Windows and the adoption runtime test runs there as well. Add a runtime test of an arf that runs in a terminal, driven through a pseudo-terminal with @microsoft/tui-test on every platform. It is discovered by its PID and adopted, evaluates and interrupts through IPC, refuses Stop while staying alive and usable, and still evaluates in its terminal after the agent closes. koffi's install script is allowed for the native library that tui-test uses.
…default policy in the terminal adoption test The guide said to start arf as usual, but a plain arf does not serve IPC, so it was not listed. It now says to type `:ipc start` in a running arf, which keeps its objects, or to start a new one with `arf --with-ipc`. The terminal adoption test started arf with `--ipc-eval-unrestricted`, which also permits silent evaluation, so code sent silently could pass there and fail against a normally configured terminal. The test now keeps arf's default policy. On success it quits R, so that arf removes its socket and session registration, and it is skipped on Windows when Node is not x64, for which the pseudo-terminal package is not published.
…ve-windows-arf-adoption
bc33715 to
e706147
Compare
Connecting to an existing arf session was not supported on Windows. With sessions listed through the arf CLI and a Stop that never signals an attached process, nothing Unix-specific remains, so this enables it and tests it on every platform.
:ipc startin a running arf, which keeps its objects, orarf --with-ipcfor a new one.@microsoft/tui-test, on every platform. The session is found by its PID and adopted, evaluates and is interrupted through IPC, refuses Stop while staying alive and usable, and still evaluates in its terminal after the agent closes. arf keeps its default policy for silent evaluation, and quits at the end so that it removes its socket. On Windows, this test needs x64 Node, for which the pseudo-terminal package is published.@microsoft/tui-testis a pinned devDependency, and koffi's install script is allowed for the native library that it uses.