fix(opencode): require relative paths in subagents #256

Merged
jwilger merged 2 commits from fix/issue-249-subagent-relative-paths into main 2026-05-18 12:38:30 -07:00
Owner

Why:

  • Subagent repo operations that use home-directory absolute paths can trip opencode permission boundaries and make subagent sessions appear stalled.
  • Closes #249

What:

  • Add a focused opencode guardrail test requiring the policy to live in exactly one shared .opencode/rules/*.md file.
  • Add .opencode/rules/path-policy.md with the project-local relative path guidance all agents read.
  • Avoid duplicating the same path-policy prose in each subagent prompt.

Validation:

  • node --test .opencode/plugins/auto-review-subagent-paths.test.ts
  • just opencode-test
Why: - Subagent repo operations that use home-directory absolute paths can trip opencode permission boundaries and make subagent sessions appear stalled. - Closes #249 What: - Add a focused opencode guardrail test requiring the policy to live in exactly one shared `.opencode/rules/*.md` file. - Add `.opencode/rules/path-policy.md` with the project-local relative path guidance all agents read. - Avoid duplicating the same path-policy prose in each subagent prompt. Validation: - node --test .opencode/plugins/auto-review-subagent-paths.test.ts - just opencode-test
fix(opencode): require relative paths in subagents
All checks were successful
CI / Classify changed paths (pull_request) Successful in 3s
CI / Clippy (pull_request) Has been skipped
CI / Format check (pull_request) Has been skipped
CI / Test (pull_request) Has been skipped
CI / Dependency policy (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / opencode plugin tests (pull_request) Successful in 7s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
auto_review auto_review: no findings
244f32589a
Why:
- Subagent repo operations using home-directory absolute paths can trip opencode permission boundaries and appear stalled.
- See issue #249.

What:
- Add a focused guardrail test for bash-capable subagent prompts.
- Instruct subagents to use project-local relative paths for repository-local shell work.

Validation:
- node --test .opencode/plugins/auto-review-subagent-paths.test.ts
- just opencode-test
auto-review approved these changes 2026-05-18 12:29:18 -07:00
Dismissed
auto-review left a comment

The PR addresses issue #249 by enforcing the use of project-local relative paths in subagent prompts to avoid permission issues. It includes updates to multiple subagent prompt files and adds a test to ensure compliance. The changes appear safe to merge.

Walkthrough

  • Subagent Prompt Updates: Each subagent prompt file now includes guidance to use project-local relative paths for repository-local shell work, avoiding absolute paths under a home-directory path.
  • Test Addition: A new test in auto-review-subagent-paths.test.ts checks that all subagent prompts include the required policy on relative paths, ensuring future compliance.
The PR addresses issue #249 by enforcing the use of project-local relative paths in subagent prompts to avoid permission issues. It includes updates to multiple subagent prompt files and adds a test to ensure compliance. The changes appear safe to merge. ## Walkthrough - **Subagent Prompt Updates**: Each subagent prompt file now includes guidance to use project-local relative paths for repository-local shell work, avoiding absolute paths under a home-directory path. - **Test Addition**: A new test in `auto-review-subagent-paths.test.ts` checks that all subagent prompts include the required policy on relative paths, ensuring future compliance.
refactor(opencode): centralize path policy
All checks were successful
CI / Classify changed paths (pull_request) Successful in 3s
CI / Clippy (pull_request) Has been skipped
CI / Format check (pull_request) Has been skipped
CI / Test (pull_request) Has been skipped
CI / Dependency policy (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / opencode plugin tests (pull_request) Successful in 6s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
auto_review auto_review: no findings
210d272d99
Why:
- Shared opencode rules avoid repeating the same path policy in every subagent prompt.
- This reduces drift while preserving the issue #249 guardrail.

What:
- Move the project-local relative path policy into .opencode/rules/path-policy.md.
- Update the guardrail test to require one shared rule and no duplicated subagent policy text.

Validation:
- node --test .opencode/plugins/auto-review-subagent-paths.test.ts
- just opencode-test
jwilger dismissed auto-review's review 2026-05-18 12:37:33 -07:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

auto-review left a comment

The PR centralizes the path policy for subagents into a single shared rule file, removing duplicated instructions from individual subagent prompts. This change should improve maintainability and consistency across subagents.

Walkthrough

Δ since 244f325:

  • Centralized Path Policy:
    • Removed duplicated path policy instructions from individual subagent files.
    • Introduced a new shared rule file .opencode/rules/path-policy.md to house the path policy.
    • Updated tests to ensure the policy is only defined in the shared rule file and not duplicated in subagent prompts.
The PR centralizes the path policy for subagents into a single shared rule file, removing duplicated instructions from individual subagent prompts. This change should improve maintainability and consistency across subagents. ## Walkthrough ### Δ since 244f325: - **Centralized Path Policy**: - Removed duplicated path policy instructions from individual subagent files. - Introduced a new shared rule file `.opencode/rules/path-policy.md` to house the path policy. - Updated tests to ensure the policy is only defined in the shared rule file and not duplicated in subagent prompts.
jwilger deleted branch fix/issue-249-subagent-relative-paths 2026-05-18 12:38:30 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!256
No description provided.