Repository navigation
Conversation
Adds a HerdrReporter hook that pushes forge state into the herdr agent pane via `herdr pane report-agent` whenever the process is running inside a herdr environment ($HERDR_ENV=1): - Start -> working - Response -> idle - ToolcallStart -> working (with tool name) - process exit -> release-agent The reporter is a no-op outside herdr (no active runner, no herdr env), so impact on plain terminal usage is zero. This is the official "add Herdr support to your agent" integration path and requires no herdr binary changes; on the herdr side it enables agent detection, sidebar presence, `herdr agent wait`, notifications and session resume.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds official Herdr agent support to forge via the documented
"Add Herdr support to your agent" integration path (
herdr pane report-agent).When forge runs inside a Herdr pane it inherits
HERDR_ENV,HERDR_PANE_ID,HERDR_BIN_PATHandHERDR_SOCKET_PATH; a lightweight hook reporter uses those topush lifecycle state so Herdr can show forge in its sidebar, wait on state, notify
on completion and restore the same session after a server restart.
Outside a Herdr pane (
HERDR_ENVunset) the reporter is a strict no-op, so plainterminal usage is unaffected.
What it reports
Startworking(+ resume argv:--conversation-id,--model)ResponseidleToolcallStartworking(tool name in message)main→release_global())release-agentSequence numbers are epoch-milliseconds (monotonic, per Herdr's requirements);
reports are fire-and-forget with a short timeout and errors ignored.
Scope
crates/forge_app/src/hooks/herdr.rs— the reporter (new)crates/forge_app/src/app.rs— wired into the hook chaincrates/forge_main/src/main.rs—release_global()on exithooks/mod.rs,lib.rs.github/workflows/build.yml— CI binary artifact builderTesting
Validated against a real
herdr 0.9.3server:forge/workinginherdr agent listwhile a turn runs,herdr agent wait <pane> --until idleresolves withagent_status: idle,forge -p ...) and interactive TUI both covered.Linked fork PR preparing the change for upstream submission.