Skip to content

feat(herdr): report session activity to herdr agent panel - #17

Merged
Blankeos merged 1 commit into
mainfrom
feat/herdr-agent-reporting
Aug 6, 2026
Merged

feat(herdr): report session activity to herdr agent panel#17
Blankeos merged 1 commit into
mainfrom
feat/herdr-agent-reporting

Conversation

@Blankeos

@Blankeos Blankeos commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Add integration to publish and release crabcode agent state via Herdr pane socket RPC when running inside a herdr pane. Introduce a new herdr module to emit startup/teardown reports and map session statuses to herdr states, add RAII session guard in main, and propagate active-session status updates from SessionManager.

Add integration to publish and release crabcode agent state via Herdr pane socket RPC when running inside a herdr pane.   Introduce a new `herdr` module to emit startup/teardown reports and map session statuses to herdr states, add RAII session guard in `main`, and propagate active-session status updates from `SessionManager`.
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying crabcode with  Cloudflare Pages  Cloudflare Pages

Latest commit: f07e209
Status: ✅  Deploy successful!
Preview URL: https://1a291c74.crabcode.pages.dev
Branch Preview URL: https://feat-herdr-agent-reporting.crabcode.pages.dev

View logs

@Blankeos

Blankeos commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author
image

Works pretty guuud

@Blankeos
Blankeos merged commit 93ade37 into main Aug 6, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f07e209a42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/session/manager.rs
Comment on lines +787 to +789
if self.current_session_id.as_deref() == Some(id) {
crate::herdr::report_session_status(status);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the report when the active session is cleared

When a user chooses New/Home or archives/deletes the current session while it is Streaming or Waiting, clear_current_session sets the current ID to None without reporting idle. Subsequent completion of that background session also skips this conditional because it is no longer current, so Herdr can continue displaying working or blocked until another session changes state or Crabcode exits.

Useful? React with 👍 / 👎.

Comment thread src/herdr.rs
"params": params,
});

let _ = send_rpc(&env.socket_path, &payload);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cache a state only after its report succeeds

If Herdr is restarting or the socket otherwise fails during connect/write, this result is discarded after LAST_STATE has already been updated. Every later report of the same state is then treated as a duplicate and suppressed, so a transient socket failure can leave the panel stale for the entire working or blocked interval; update the cache only after a successful RPC, or clear it on failure.

Useful? React with 👍 / 👎.

Comment thread src/herdr.rs
Comment on lines +170 to +171
let started = Instant::now();
let mut stream = UnixStream::connect(socket_path)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce the connect timeout before blocking

When the Unix socket's accept queue is stalled or full, UnixStream::connect is a blocking call and can exceed the intended 80 ms limit because elapsed time is checked only after it returns. Since reporting runs synchronously from session-status handling, an unhealthy Herdr daemon can stall Crabcode's event loop well beyond the configured timeout; the connection itself needs to be nonblocking or moved off the event-loop thread.

Useful? React with 👍 / 👎.

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