Skip to content

Hardening up#376

Merged
khaliqgant merged 8 commits into
mainfrom
hardening-up
Feb 5, 2026
Merged

Hardening up#376
khaliqgant merged 8 commits into
mainfrom
hardening-up

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Feb 5, 2026

  • better path search for relay-pty
  • Better instructions

Fixes #374 #373


Open with Devin

khaliqgant and others added 5 commits February 5, 2026 09:02
…s dialog

Gemini CLI shows "Action Required" permission prompts even with --yolo for
shell redirects/heredocs. Detect the prompt and auto-send "2" to select
"Allow for this session" with 2s cooldown for repeated prompts.

Newer Claude Code versions show a confirmation dialog for
--dangerously-skip-permissions where the default is "No, exit", causing
immediate agent termination. Detect the dialog and auto-send "y" to accept.

Both detections use buffer accumulation + ANSI stripping + pattern matching
with 5s timeout fallback for fragmented output. Extracted into testable
helper functions with 16 new unit tests covering full/partial matches,
false positives, ANSI codes, and edge cases.

Closes #373, relates to Gemini permission handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address Codex review feedback on the auto-approval detection:

1. Bypass permissions timeout now requires BOTH bypass reference AND
   confirmation prompt (was || now &&). Prevents auto-sending "y" to
   unrelated yes/no prompts like "Delete file? (yes/no)".

2. Gemini action timeout now requires BOTH "Action Required" header AND
   allow option text (was || now &&). Prevents stray approvals when only
   the header appears in non-permission contexts.

3. Gemini auto-approval now sends "2\n" instead of bare "2" to ensure
   the prompt closes properly in all terminal modes.

4. Added 4 new timeout-safety tests verifying single-signal scenarios
   cannot trigger timeout-based approval.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment thread src/cli/index.ts Outdated
khaliqgant and others added 3 commits February 5, 2026 09:39
… npm path

Address code review findings:

1. Remove dead timeout code from bypass-perms and Gemini detectors.
   With && logic, timeout was identical to full_match and unreachable.
   Simplified both to direct full_match check (~70 lines removed).

2. Document why MCP timeout intentionally keeps || (one-shot AtomicBool +
   highly specific "MCP Server Approval Required" header makes partial
   match timeout safe, unlike the generic signals in other detectors).

3. Fix "ermission" pattern to "permission" - the .to_lowercase() already
   handles case, so the leading "p" should be included for clarity and
   to avoid accidental substring matches.

4. Replace tautological timeout-safety tests with meaningful false-positive
   scenario tests using real-world prompt strings.

5. Fix #374 for npm install: add process.execPath-based universal fallback
   for global npm module discovery. Derives <prefix>/lib/node_modules/ from
   Node's own binary path, covering ALL version managers (nvm, volta, fnm,
   mise, asdf, n, system, Homebrew, direct download).

Closes #374

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Run cargo fmt to fix all formatting issues flagged by CI. Also change
the git repository check on `agent-relay up` from a hard error to a
warning so the command works outside git repos.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The devDependency was pinned to 2.1.14 while the workspace version is
2.1.17, causing CI build to fail with TS2307 module not found error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 8bbea1c into main Feb 5, 2026
39 checks passed
@khaliqgant khaliqgant deleted the hardening-up branch February 5, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relay-pty binary not found (Error ID: ERR-1770270193-c26c - share this with support)

1 participant