Skip to content

feat(herdr): report forge lifecycle state to herdr (opt-in, no-op outside Herdr) - #3974

Open
bugakov wants to merge 1 commit into
tailcallhq:mainfrom
bugakov:feat/herdr-integration-upstream
Open

bugakov wants to merge 1 commit into
tailcallhq:mainfrom
bugakov:feat/herdr-integration-upstream

Conversation

@bugakov

@bugakov bugakov commented Oct 4, 2026 •

Copy link
Copy Markdown

Summary

While running forge inside Herdr, I noticed there's no way
for Herdr to know when forge is working, idle, or needs input. Herdr documents
a first-party integration path for exactly this — "Add Herdr support to your
agent" (herdr pane report-agent) — so I implemented it for forge.

The change is fully opt-in and a strict no-op outside Herdr; it cannot
affect normal terminal usage.

How it works

When forge runs inside a Herdr pane it inherits HERDR_ENV, HERDR_PANE_ID,
HERDR_BIN_PATH and HERDR_SOCKET_PATH. A small reporter hooked into forge's
existing lifecycle events turns those into state reports:

Event Report
Start working (+ resume argv)
Response idle
ToolcallStart working (with tool name)
forge exits release-agent

Reports are fire-and-forget (background spawn, short timeout, errors ignored),
so Herdr can never slow forge down. seq is epoch-milliseconds as Herdr
recommends. On the Herdr side this enables: showing forge in the sidebar,
herdr agent wait, completion notifications, and restoring the same session
after a server restart.

Files

  • crates/forge_app/src/hooks/herdr.rs (new)
  • crates/forge_app/src/hooks/mod.rs
  • crates/forge_app/src/app.rs
  • crates/forge_app/src/lib.rs
  • crates/forge_main/src/main.rs

No new dependencies. Verified against Herdr 0.9.3 (local server).

Happy to adjust anything (naming, placement, or wiring) to fit your
conventions. Thanks for the great tool!

@CLAassistant

CLAassistant commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions Bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Oct 9, 2026
@bugakov
bugakov force-pushed the feat/herdr-integration-upstream branch from c0be8f7 to 0afd6d4 Compare October 10, 2026 10:13
@github-actions github-actions Bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Oct 10, 2026
@bugakov
bugakov force-pushed the feat/herdr-integration-upstream branch from 54cc575 to 973f8af Compare October 15, 2026 11:32
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.
@bugakov
bugakov force-pushed the feat/herdr-integration-upstream branch 2 times, most recently from 7adcdbe to 66c2b39 Compare October 15, 2026 15:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants