Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function inspectWorkspacePath(
}));
} catch (error) {
// Exit 128 = not inside a git work tree: a plain directory, not a failure.
if (error instanceof ExecError && error.exitCode !== null) return { kind: 'directory' };
if (error instanceof ExecError && error.exitCode === 128) return { kind: 'directory' };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Exit 128 Is Ambiguous

Git also returns exit code 128 for fatal errors such as permission failures. In those cases, this branch classifies an inaccessible or broken repository as a plain directory instead of inspect-failed, so the workspace registry can accept it without surfacing the inspection error. The existing Git runtime avoids this by matching known non-repository messages rather than relying only on the exit code.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/runtimes/workspace-registry/node/inspect-path.ts
Line: 49

Comment:
**Exit 128 Is Ambiguous**

Git also returns exit code 128 for fatal errors such as permission failures. In those cases, this branch classifies an inaccessible or broken repository as a plain directory instead of `inspect-failed`, so the workspace registry can accept it without surfacing the inspection error. The existing Git runtime avoids this by matching known non-repository messages rather than relying only on the exit code.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

return {
kind: 'inspect-failed',
message: error instanceof Error ? error.message : String(error),
Expand Down