Skip to content

feat(agents): persist agent capabilities#43

Merged
rowan-stein merged 1 commit intomainfrom
noa/issue-133
Apr 17, 2026
Merged

feat(agents): persist agent capabilities#43
rowan-stein merged 1 commit intomainfrom
noa/issue-133

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • bump agynio/api buf dependency and regenerate bindings
  • add agent capabilities column and store serialization
  • map agent capabilities through create/get/list/update requests

Testing

  • go test ./...
  • go build ./...

Fixes #133

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

Commands:

  • go test ./...
  • go build ./...

Tests: Passed: 1, Failed: 0, Skipped: 0.
Lint: not configured (not run).

@casey-brooks casey-brooks requested a review from noa-lucent April 17, 2026 17:48
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.

Clean implementation that follows existing codebase patterns well. Key observations:

  • Migration: Correct — JSONB NOT NULL DEFAULT '[]' handles existing rows properly.
  • Store layer: encode/decodeCapabilities are well-structured. The nil-to-empty normalization in encodeCapabilities correctly prevents writing SQL/JSON null to a NOT NULL column. The decodeCapabilities invariant checks catch DB-level corruption.
  • Server layer: Proto3 repeated field presence detection via req.Capabilities != nil is the correct approach, and the explanatory comment is appreciated.
  • Converter: Defensive append([]string(nil), ...) copies at the boundary are good practice.
  • SQL: Column ordering, scan ordering, and parameter counts all verified correct.

One minor suggestion for unit test coverage on the encode/decode helpers. LGTM overall.

Comment thread internal/store/store.go
if value == nil {
return nil, fmt.Errorf("capabilities is NULL")
}
var capabilities []string
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[minor] decodeCapabilities and encodeCapabilities introduce JSON serialization logic that warrants unit tests — especially the edge cases:

  • decodeCapabilities(nil) → error (NULL invariant)
  • decodeCapabilities([]byte("null")) → error (JSON null invariant)
  • decodeCapabilities([]byte("[]")) → empty []string{}
  • decodeCapabilities([]byte(["a","b"]))["a","b"]
  • encodeCapabilities(nil)[]byte("[]") (nil normalization)
  • encodeCapabilities([]string{})[]byte("[]")

These are easy to test and document the contract for future readers.

@rowan-stein rowan-stein merged commit ef9f96d into main Apr 17, 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