-
Notifications
You must be signed in to change notification settings - Fork 64
feat(broker): log agent-name reclaims with their audit id #1601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
|
|
||
| - Agent-name reclaims are now logged. A takeover records the agent, its id and the engine's audit id at `info`; a crash recovery through the recover route does the same; and both log a `warn` when they fall back to the legacy workspace-key rotate on an engine older than 8.2.0, which produces no audit record. Previously a reclaim was only visible as the absence of a `401`, which is indistinguishable from the name never having collided. Tokens are never logged. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Remove the implementation backstory from this entry. Keep one concise bullet that states the new logging outcome. Remove “Previously a reclaim was only visible...” because it explains prior implementation behavior instead of the pending change. As per coding guidelines, “Do not add ... implementation backstory ... to 🧰 Tools🪛 LanguageTool[style] ~12-~12: To make your writing flow more naturally, try moving the adverb ‘never’ closer to the verb ‘collided’. (PERF_TENS_ADV_PLACEMENT) 🤖 Prompt for AI AgentsSource: Coding guidelines There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this is the first user-visible entry after the 11.8.2 release, leaving the heading as plain AGENTS.md reference: AGENTS.md:L36-L39 Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This bullet includes three internal control-flow paths, engine-version details, historical 401 backstory, and a token-safety assertion instead of a concise surface-and-impact summary. Reduce it to a short AGENTS.md reference: AGENTS.md:L45-L49 Useful? React with 👍 / 👎. |
||
|
|
||
| ## [11.8.2] - 2026-08-22 | ||
|
|
||
| ### Fixed | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1087,19 +1087,37 @@ async fn admit_agent_registration( | |
| // agent-specific 404 (`agent_not_found`) is a real failure and is | ||
| // deliberately excluded. | ||
| let token_response = match token_response { | ||
| Ok(response) => response.token, | ||
| Ok(response) => { | ||
| // Same reasoning as the takeover path in ws.rs: the audit id | ||
| // ties this recovery to the engine's audit record, so a | ||
| // crash reclaim is checkable rather than inferred. | ||
| tracing::info!( | ||
| agent = %existing.name, | ||
| agent_id = %existing.id, | ||
| audit_id = %response.audit_id, | ||
| "recovered agent identity via the recover route" | ||
| ); | ||
| response.token | ||
| } | ||
| Err(RelayError::Api { | ||
| status: 404, | ||
| ref code, | ||
| .. | ||
| }) if code != "agent_not_found" => relay | ||
| .rotate_agent_token(&existing.name, workspace_key) | ||
| .await | ||
| .map_err(relay_error_to_anyhow) | ||
| .context( | ||
| "recover unavailable on this engine and the legacy rotate fallback failed", | ||
| )? | ||
| .token, | ||
| }) if code != "agent_not_found" => { | ||
| tracing::warn!( | ||
| agent = %existing.name, | ||
| agent_id = %existing.id, | ||
| "recover route absent on this engine; fell back to the legacy workspace-key rotate (unaudited)" | ||
| ); | ||
|
Comment on lines
+1107
to
+1111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On a pre-8.2 engine where Useful? React with 👍 / 👎. |
||
| relay | ||
| .rotate_agent_token(&existing.name, workspace_key) | ||
| .await | ||
| .map_err(relay_error_to_anyhow) | ||
| .context( | ||
| "recover unavailable on this engine and the legacy rotate fallback failed", | ||
| )? | ||
| .token | ||
| } | ||
| Err(error) => return Err(relay_error_to_anyhow(error)), | ||
| }; | ||
| Ok(( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changelog heading missing required release level
The first pending entry is added under
## [Unreleased](CHANGELOG.md:8), but AGENTS.md requires the first pending change to set the heading to[Unreleased - Patch],[Unreleased - Minor], or[Unreleased - Major]. The heading is left bare.Was this helpful? React with 👍 or 👎 to provide feedback.