Skip to content

feat: add agent availability roles#52

Merged
rowan-stein merged 3 commits into
mainfrom
noa/issue-51
May 13, 2026
Merged

feat: add agent availability roles#52
rowan-stein merged 3 commits into
mainfrom
noa/issue-51

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

Validation

  • See the tracking issue and PR comments for repo-specific test/lint results.

Closes #51

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • nix shell nixpkgs#buf nixpkgs#gcc -c sh -c 'mkdir -p proto && cp -R /workspace/api/proto/agynio proto/agynio && buf generate --path proto/agynio/api/agents/v1 --path proto/agynio/api/authorization/v1 --path proto/agynio/api/identity/v1 --path proto/agynio/api/notifications/v1 && mkdir -p .gen/go/agynio/api/agents/v1 .gen/go/agynio/api/authorization/v1 .gen/go/agynio/api/notifications/v1 && mv .gen/go/proto/agynio/api/agents/v1/* .gen/go/agynio/api/agents/v1/ && mv .gen/go/proto/agynio/api/authorization/v1/* .gen/go/agynio/api/authorization/v1/ && mv .gen/go/proto/agynio/api/notifications/v1/* .gen/go/agynio/api/notifications/v1/ && mv proto /tmp/agents-proto-test-51 && go test ./...'
    • Test stats: 1 package passed, 0 failed, 0 skipped; 5 packages had no test files.

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.

Thanks for the implementation. I found blocking issues: the PR currently fails to build because the generated API bindings do not include the new proto types, and the role set/remove flows can leave the database and OpenFGA authorization state inconsistent on partial failure. Requesting changes.

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

Addressed Noa's requested changes:

  • Updated CI generation to use the API feature branch contract until the API module publishes the new generated bindings.
  • Added rollback handling so SetAgentRole restores/removes the DB assignment if OpenFGA write fails.
  • Added rollback handling so RemoveAgentRole restores the DB assignment if OpenFGA delete fails.

Validation:

  • nix shell nixpkgs#buf nixpkgs#gcc -c buf generate 'https://github.com/agynio/api.git#branch=noa/issue-51-agent-availability' --path proto/agynio/api/agents/v1 --path proto/agynio/api/authorization/v1 --path proto/agynio/api/identity/v1 --path proto/agynio/api/notifications/v1 passed.
  • nix shell nixpkgs#gcc -c go test ./... passed: 1 package passed, 5 packages with no tests, 0 failed, 0 skipped.
  • nix shell nixpkgs#gcc -c go build ./... passed.
  • Lint status: Go formatting (gofmt) applied; no lint errors found in local validation.

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.

Thanks for the fixes. The DB/OpenFGA rollback handling now addresses my previous consistency comments, but CI is still failing in the updated protobuf generation workflow before tests/build run. Requesting changes until the workflow is green.

Comment thread .github/workflows/ci.yml
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.

Refreshed at head 17a5cb1. The role consistency fixes are still good, but the PR remains blocked because CI is still failing in protobuf generation before tests/build run. The unresolved CI workflow comment still applies.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Fixed the remaining CI protobuf generation issue in the same PR/branch.

What changed:

  • Removed the incorrect .gen/go/proto/... move steps from the workflow.
  • Verified that buf generate https://github.com/agynio/api.git#branch=noa/issue-51-agent-availability ... writes directly to .gen/go/agynio/api/... with this repo's go_package_prefix config.

Validation:

  • nix shell nixpkgs#buf nixpkgs#gcc -c buf generate 'https://github.com/agynio/api.git#branch=noa/issue-51-agent-availability' --path proto/agynio/api/agents/v1 --path proto/agynio/api/authorization/v1 --path proto/agynio/api/identity/v1 --path proto/agynio/api/notifications/v1 passed.
  • nix shell nixpkgs#gcc -c go test ./... passed: 1 package passed, 5 packages with no tests, 0 failed, 0 skipped.
  • nix shell nixpkgs#gcc -c go build ./... passed.
  • Lint status: workflow-only change; no lint errors found in local validation.

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-review complete at head 9650cb7. The protobuf generation workflow now runs without the bad move step, CI is green (go test ./... and go build ./... pass), and the previous role consistency fixes remain in place. Approved.

@rowan-stein rowan-stein merged commit 0a4d366 into main May 13, 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.

Implement agent availability and per-agent roles

3 participants