Repository navigation
Conversation
LogFileWriter's constructor mkdir -p'd ~/.argent/tmp unguarded, so a root-owned ~/.argent (the state a sudo-run argent leaves behind) threw a plain EACCES out of the JS-runtime-debugger factory. classifyNotConnected finds no failure code on it, so debugger-status and debugger-log-registry rethrow it raw instead of returning the discriminated not-connected result their descriptions promise. Swallowing the mkdir lands that state on the path an unwritable ~/.argent/tmp already takes: open() fails, entries buffer in memory, and the debugger connection survives.
This comment has been minimized.
This comment has been minimized.
…kdir-eacces # Conflicts: # packages/tool-server/test/debugger/log-file-writer.test.ts
…exist A writer that could not create its file (unwritable ~/.argent or ~/.argent/tmp) still handed back a `file` path that the tool description tells the agent to read, with nothing saying it is missing. debugger-log-registry now adds a `note` naming the missing file, the likely cause and the fix.
latekvo
force-pushed
the
fix/log-file-writer-mkdir-eacces
branch
from
September 10, 2026 14:26
cc40edc to
f8b5abd
Compare
Member
Author
|
Still reproduces as of 2026-09-28 (main |
hubgan
reviewed
Sep 29, 2026
hubgan
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, I think you can merge it if you're fine with SKILL.md and tool description change.
Drop the SKILL.md line (the note describes itself in the tool output), correct the note field's JSDoc, and pin the reaped + missing-file note concatenation in a test.
latekvo
marked this pull request as ready for review
October 12, 2026 15:16
# Conflicts: # packages/tool-server/src/tools/debugger/debugger-log-registry.ts # packages/tool-server/src/utils/debugger/log-file-writer.ts # packages/tool-server/test/metro/teardown-log-history.test.ts
Member
Author
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.
Fixes #908
Cause -
LogFileWriter's constructor ranmkdir -p ~/.argent/tmpwith no guard. Under a root-owned~/.argent(what a sudo-run argent leaves behind) that threw a plainEACCESout of the JS-runtime-debugger factory, sodebugger-status,debugger-connectanddebugger-log-registryfailed with it instead of connecting.Fix - swallow the
mkdirSyncfailure so the writer runs without a file, as it already does when~/.argent/tmpis unwritable.debugger-log-registryadds anotewhenever itsfiledoes not exist, saying how to fix permissions and how to get a session that has a file.debugger-log-registryunder a root-owned~/.argentEACCES: permission denied, mkdir '~/.argent/tmp'status: "connected", counts and clusters, plusnote: "No log file exists at <file> ... sudo chown -R "$USER" ~/.argent ... call stop-all-simulator-servers with devices: ["<id>"], then debugger-connect again."Docs: only the tool description changes. No docs-site page describes this output.
Verification
HOMEset to a temp dir whose.argentis0500and a mock Metro. On main,debugger-status,debugger-connectanddebugger-log-registryreturn HTTP 500EACCES. On this branch they returnconnectedplus the note. Running the note's steps (chmod 700, thenstop-all-simulator-servers {devices:["dev-1"]}, thendebugger-connect) gives a new session with a log file on disk and no note.test/metro/teardown-log-history.test.tsdrives Registry ->JsRuntimeDebugger->debugger-connect->debugger-log-registrythe same way. Each of these mutations turns it red: main's source (3 tests), the note overwriting the reaped-session note (1), the note's stop-all hint removed (1).npx tsc --build,typecheck:tests, the tool-server suite (6750 passed, 1 skipped), and eslint and prettier on the changed files are all clean.