Skip to content

Persist agent nicknames#42

Merged
rowan-stein merged 2 commits intomainfrom
noa/issue-132
Apr 12, 2026
Merged

Persist agent nicknames#42
rowan-stein merged 2 commits intomainfrom
noa/issue-132

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • add agent nickname persistence + migration
  • wire identity nickname updates for agent lifecycle
  • refresh generated identity bindings

Testing

  • buf generate buf.build/agynio/api --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/identity/v1
  • go test ./...
  • go vet ./...

Closes #132

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • go test ./... (passed: 0, failed: 0, skipped: 0)
  • go vet ./... (no issues)

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Overall the PR is well-structured — the store/types/converter/identity plumbing is clean and follows existing patterns consistently. The generated protobuf changes look correct.

One major issue: the CreateAgent nickname-failure rollback path does not deregister the identity that was successfully registered in the prior step, leaving an orphaned identity record. This needs to be fixed before merge.

One minor note on the migration numbering gap (0009 → 0011).

Comment thread internal/server/server.go
Comment thread migrations/0011_agent_nickname.sql
@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • go test ./... (passed: 0, failed: 0, skipped: 0)
  • go vet ./... (no issues)

noa-lucent
noa-lucent previously approved these changes Apr 12, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Both prior comments are addressed:

  1. Rollback fix (major): The CreateAgent nickname-failure path now includes best-effort RemoveNickname cleanup (swallowing NOT_FOUND), and surfaces any other cleanup errors via errors.Join. Given the identity service has no delete RPC, this is the correct approach — pragmatic and properly documented with the inline comment.

  2. Migration gap (minor): Confirmed reserved by PR #40. No issue.

Code is clean, CI green. Approving.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • go test ./... (passed: 0, failed: 0, skipped: 0)
  • go vet ./... (no issues)

noa-lucent
noa-lucent previously approved these changes Apr 12, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Re-reviewed after rebase onto latest main (which brought in the idle_timeout feature from PR #41).

Prior feedback status:

  1. Rollback fix (major): Still in place — CreateAgent nickname-failure path includes best-effort RemoveNickname cleanup with NOT_FOUND handling.
  2. Migration gap (minor): Resolved — 0010_add_idle_timeout.sql is now present from the rebase.

Rebase integration check:

  • agentColumns correctly includes both nickname and idle_timeout in proper order.
  • scanAgent field list matches the column order.
  • CreateAgent INSERT columns/parameters are consistent.
  • UpdateAgent handles both Nickname and IdleTimeout independently and correctly.
  • toProtoAgent maps both fields.

No new issues introduced. Approving.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • go test ./... (passed: 1, failed: 0, skipped: 0)
  • go vet ./... (no issues)

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Re-reviewed after second rebase (now includes volume TTL from main).

The nickname-specific code is unchanged from the previously approved version. Rebase integration is clean — no conflicts or regressions in the nickname logic.

All prior feedback remains addressed. Approving.

@rowan-stein rowan-stein merged commit 68a9ecf into main Apr 12, 2026
1 check passed
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.

3 participants