Repository navigation
Conversation
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
`makeScreenshotCommand` and `makeDumpCommand` hardcoded `/tmp/<site>-*` as their output destination. `/tmp` is not a temp directory on Windows: Node resolves it against the current drive root, so `<site> screenshot` and `<site> dump` create a stray `\tmp` folder at the root of whichever drive the process runs from, and fail outright with EPERM when that root is not writable for the current user. Use `os.tmpdir()` for both defaults and for the `--output` help text, so the shipped `@agentrhq/webcmd/plugin-runtime` factories behave the same on every platform. An explicit `output` argument is still honoured unchanged.
Agnik47
force-pushed
the
fix/plugin-runtime-os-tmpdir
branch
from
October 2, 2026 04:22
72004fe to
527917f
Compare
Contributor
Author
|
Rebased onto current |
adikulkarni006
approved these changes
Oct 6, 2026
This branch has not been deployed
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.
Problem
makeScreenshotCommandandmakeDumpCommandinsrc/plugin-runtime.ts— bothpart of the public
@agentrhq/webcmd/plugin-runtimesurface — hardcode/tmp/<site>-*as their output destination./tmpis not a temp directory on Windows. Node resolves it against the currentdrive root:
So on Windows
<site> screenshotand<site> dumpsilentlymkdirSynca stray\tmpfolder at the root of whichever drive the process happens to run from, andfail with
EPERMwhen that root is not writable for the current user (the commoncase for a non-elevated user on
C:\).The repo supports Windows deliberately —
win32branches already exist inplugin.ts,discovery.ts,skills.ts,external.tsanderrors.ts— so thesetwo defaults are the odd ones out.
Fix
Use
os.tmpdir()for both defaults and for the--outputhelp text. Five lines insrc/plugin-runtime.ts. Behaviour is unchanged on Linux (os.tmpdir()is/tmp),and an explicit
outputargument is still honoured exactly as before.Tests
desktop command factoriestest was asserting the/tmpliteralsitself, so it is rewritten against
os.tmpdir().defaults screenshot and dump output to the OS temp dir: relocates thetemp directory through
TMPDIR(POSIX) /TEMP+TMP(Windows) —os.tmpdir()reads those on every call, so no builtin-module mocking is needed — then asserts
the help text, both returned paths, and every file actually written land inside
it. This fails on Linux too, not just Windows.
Verification
npx vitest run --project unit src/plugin-runtime.test.ts→ 15 passed.src/plugin-runtime.tschange and re-ran the same file → 2 failed,reporting
/tmp/runtime-test-…against the expected temp dir, confirming the newtest genuinely catches the regression rather than passing vacuously.
npx tsc --noEmit→ clean.docs/,skills/,skill-src/,mcp-skills/andplugins/for thesepaths — nothing documents them, so no docs change is needed.
Deliberately out of scope
src/browser/command-catalog.ts:25also mentions/tmp/upload.pdf, but that is ahelp-text example of a caller-supplied path, not a destination webcmd writes to.