Skip to content

Avoid main-thread executable resolution#34

Merged
trydis merged 3 commits intomainfrom
agentruntimebridge.resolveexecutable-blocks-main-thread
Mar 18, 2026
Merged

Avoid main-thread executable resolution#34
trydis merged 3 commits intomainfrom
agentruntimebridge.resolveexecutable-blocks-main-thread

Conversation

@trydis
Copy link
Owner

@trydis trydis commented Mar 18, 2026

Summary by CodeRabbit

  • Refactor

    • Simplified runtime environment: removed internal binary-resolution/caching; environment still wraps PATH and preserves an ORIGINAL_PATH fallback. Wrapper scripts now compute real tool paths at runtime using ORIGINAL_PATH and PATH.
  • Tests

    • Added/extended tests to verify environment variable injection (including ORIGINAL_PATH) and that wrappers perform runtime lookup and PATH-based invocation.

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: afe15449-ed58-4b1a-b9b5-1b2d5841bd60

📥 Commits

Reviewing files that changed from the base of the PR and between ee9efca and 0597d76.

📒 Files selected for processing (2)
  • Sources/Shellraiser/Infrastructure/Agents/AgentRuntimeBridge.swift
  • Tests/ShellraiserTests/AgentRuntimeBridgeTests.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • Tests/ShellraiserTests/AgentRuntimeBridgeTests.swift
  • Sources/Shellraiser/Infrastructure/Agents/AgentRuntimeBridge.swift

📝 Walkthrough

Walkthrough

Removed the private executable-path cache and resolver from the agent runtime bridge; wrapper scripts now resolve Claude/Codex binaries at runtime using a lookup based on SHELLRAISER_ORIGINAL_PATH. Tests added to confirm environment injection no longer provides resolved binary paths.

Changes

Cohort / File(s) Summary
Agent Runtime Bridge
Sources/Shellraiser/Infrastructure/Agents/AgentRuntimeBridge.swift
Deleted private cachedExecutablePaths dictionary and resolveExecutable(named:searchPath:) helper; removed logic that set SHELLRAISER_REAL_CLAUDE and SHELLRAISER_REAL_CODEX when building the environment.
Wrapper scripts written by bridge
(generated files: claude/codex wrappers)
Updated wrappers to compute real binary paths at runtime by deriving a lookup_path from SHELLRAISER_ORIGINAL_PATH and invoking binaries via PATH lookup instead of using pre-resolved paths.
Agent Runtime Bridge Tests
Tests/ShellraiserTests/AgentRuntimeBridgeTests.swift
Added testEnvironmentInjectsManagedWrapperVariablesWithoutResolvedBinaryPaths; asserts PATH wrapping and other injected variables, and that SHELLRAISER_REAL_CLAUDE and SHELLRAISER_REAL_CODEX are nil. Also extended wrapper content assertions to verify lookup_path usage and PATH-based invocation.

Possibly related PRs

  • Fix Claude completion notifications #9 — Modifies AgentRuntimeBridge's managed wrapper generation; touches similar wrapper-generation logic and may overlap with changes to Claude wrapper injection.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Avoid main-thread executable resolution' directly addresses the core change: removing synchronous executable path resolution (which blocks the main thread) and deferring it to runtime via wrapper scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agentruntimebridge.resolveexecutable-blocks-main-thread
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@trydis trydis merged commit 5fa3a73 into main Mar 18, 2026
2 checks passed
@trydis trydis deleted the agentruntimebridge.resolveexecutable-blocks-main-thread branch March 18, 2026 21:48
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.

1 participant