Skip to content

refactor(agent-identity): read a reported status in reportedStatus() - #3330

Merged
devswha merged 1 commit into
mainfrom
lane/hc-agent-status
Nov 8, 2026
Merged

devswha merged 1 commit into
mainfrom
lane/hc-agent-status

Conversation

@devswha

@devswha devswha commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Summary

Moves herdr-core's mapping from a program's own status word to herdr's (working, blocked, idle, done; an error or an unknown word reads as unknown) into server/agent-identity.ts as reportedStatus(). agentStatusOf in server/herdr-core/snapshot.ts now calls it. No behaviour change.

It is the first step of moving status into the runtime-neutral agent-identity module, after the agent name (#3308) and the session (#3320, #3324). The next change uses it for Letta's status when no report gives one.

Validation

  • bun run check fast: ok (typecheck, build, unit 13060 pass).
  • New unit test for the mapping in server/agent-identity.test.ts. The existing herdr-core snapshot and adapter status tests pass unchanged.

Move herdr-core's status-word mapping into agent-identity.ts, with no behaviour change.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Agent statuses now consistently show as working, blocked, idle, or done when reported. error, unrecognized values, and missing statuses are shown as unknown.

The change adds reportedStatus to normalize agent status values. agentStatusOf delegates status conversion to it, and tests cover recognized statuses and inputs that map to unknown.

Changes: Agent status normalization

Layer / File(s) Summary
Normalize reported agent status
server/agent-identity.ts, server/herdr-core/snapshot.ts, server/agent-identity.test.ts
reportedStatus preserves working, blocked, idle, and done, and maps other values to unknown. agentStatusOf delegates to this function. Tests cover these mappings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related PRs

  • devswha/ovis#2455: Defines a related status mapping in agentStatusOf, including mapping an error report to unknown.

Suggested reviewers: nahwan-kim

Merge Risk: Minimal · up to 2b17e

The status mapping is extracted into a shared helper without an identified behavior change. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the change: moving the status-word mapping into reportedStatus() in agent-identity. It fits the diff, which adds reportedStatus() and makes agentStatusOf call it. The title is concise …
Description check Passed The description covers the change, its intent, and the validation performed. It states that the change makes no behaviour change and links it to the wider status migration. It follows the template's C…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: moving the status-word mapping into reportedStatus() in agent-identity. It fits the diff, which adds reportedStatus() and makes agentStatusOf call it. The title is concise and uses a conventional refactor prefix. It omits the no-behaviour-change aspect, which is acceptable.

Full details: Description check

Explanation

The description covers the change, its intent, and the validation performed. It states that the change makes no behaviour change and links it to the wider status migration. It follows the template's Change and Validation sections. It does not link the issue, but the change is a refactor step in a series, so the omission is minor. The Change section does not say whether a changelog.d entry is needed, and the Validation section does not mention contract tests, which the template only requires for HTTP/WS changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 60ecea2 and 2b17e11.

Files selected for processing: 3

  • server/agent-identity.test.ts
  • server/agent-identity.ts
  • server/herdr-core/snapshot.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@devswha
devswha merged commit 4c508d9 into main Nov 8, 2026
30 of 31 checks passed
@devswha

devswha commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Merge note (merge pass) at head 2b17e11:

  • Merged on GitHub's required checks, all green on this head (Fast checks, Integration and browser, Native Windows install).
  • omo review receipt: CLEAR at this exact head. Unresolved review threads: 0 (GraphQL). CodeRabbit: success.
  • Move-only refactor: herdr-core's reported-status mapping moves unchanged from server/herdr-core/snapshot.ts into reportedStatus() in server/agent-identity.ts (working/blocked/idle/done kept, anything else unknown); read in full by the merge pass, a unit test covers the function. The first Fast checks run failed in server/dialogs/pi-ask-user-route.test.ts, which this PR does not touch and which passes alone 3/3 on main and here; it passed on rerun.

@devswha
devswha deleted the lane/hc-agent-status branch November 8, 2026 05:37
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