Skip to content

feat(ponytail): SubagentStart agent_type regex matcher - #91

Merged
getappz merged 1 commit into
masterfrom
fix/subagent-matcher
Jul 7, 2026
Merged

feat(ponytail): SubagentStart agent_type regex matcher#91
getappz merged 1 commit into
masterfrom
fix/subagent-matcher

Conversation

@getappz

@getappz getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner
  • Add subagent_should_inject() — reads PONYTAIL_SUBAGENT_MATCHER env var
  • Case-insensitive regex match against agent_type from SubagentStart stdin
  • Fail-open: invalid regex, missing agent_type, stdin timeout → inject anyway
  • Default path (no matcher): inject everywhere, no stdin read
  • 1s stdin timeout, never blocks
  • Matches upstream ponytail#507 design
  • Closes ponytail PR audit ticket [ponytail#507] SubagentStart hook: agent_type regex matcher via PONYTAIL_SUBAGENT_MATCHER #62

Summary by CodeRabbit

  • New Features

    • Added configurable matching for when startup hooks are inserted, based on runtime input and an environment setting.
    • Hook handling now supports case-insensitive matching and safer fallback behavior when input or configuration is unavailable.
  • Bug Fixes

    • Improved reliability by avoiding missed hook injection when input can’t be read, JSON is invalid, or the match pattern is unusable.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 60aa80b7-3539-4d67-ba6b-17bb85640a17

📥 Commits

Reviewing files that changed from the base of the PR and between 55c2963 and c0a181c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/cli/ponytail.rs
 ___________________________________
< Not your grandma's code reviewer. >
 -----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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 fix/subagent-matcher

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

@getappz

getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@getappz

getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

- Add subagent_should_inject() — reads PONYTAIL_SUBAGENT_MATCHER env var
- Case-insensitive regex match against agent_type from SubagentStart stdin
- Fail-open: invalid regex, missing agent_type, stdin timeout → inject anyway
- Default path (no matcher): inject everywhere, no stdin read
- 1s stdin timeout, never blocks
- Matches upstream ponytail#507 design
- Closes ponytail PR audit ticket #62
@getappz
getappz force-pushed the fix/subagent-matcher branch from 7445088 to c0a181c Compare July 7, 2026 18:39
@getappz
getappz merged commit 8f3c8f1 into master Jul 7, 2026
8 of 9 checks passed
@getappz
getappz deleted the fix/subagent-matcher branch July 7, 2026 18:39
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant