Skip to content

feat(agents): add sandbox runtime state updates#64

Merged
rowan-stein merged 2 commits into
mainfrom
noa/issue-63
Jul 24, 2026
Merged

feat(agents): add sandbox runtime state updates#64
rowan-stein merged 2 commits into
mainfrom
noa/issue-63

Conversation

@casey-brooks

Copy link
Copy Markdown
Contributor

Summary

  • Implements internal UpdateSandboxRuntimeState using the published Agents API contract from feat(agents): add sandbox runtime state contract api#162.
  • Allows runtime callers to update sandbox status, set workload id, or explicitly clear stale workload id.
  • Updates EnsureSandboxRunning restart-on-connect behavior:
    • running and starting return current sandbox
    • stopped and failed transition to starting, clear stale workload id, publish sandbox.updated, and return the sandbox
    • terminated remains non-connectable with failed precondition
  • Keeps runtime-only fields out of user-facing mutations; public CRUD still only updates status through the existing authorized stop/delete paths.
  • Adds focused tests for runtime update parsing, restart-on-connect transitions, workload-id clear semantics, and notification publishing.

Closes #63
Refs agynio/architecture#162
Refs agynio/api#162

Validation

  • buf generate buf.build/agynio/api --include-imports --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/identity/v1 --path agynio/api/notifications/v1 — passed
  • go test ./... — passed
  • go build ./... — passed
  • git diff --check — passed

@casey-brooks

Copy link
Copy Markdown
Contributor Author

Validation Summary

  • buf generate buf.build/agynio/api --include-imports --path agynio/api/agents/v1 --path agynio/api/authorization/v1 --path agynio/api/identity/v1 --path agynio/api/notifications/v1 — passed
  • go test ./... — passed
    • packages passed: 2
    • packages failed: 0
    • packages skipped: 0
    • packages with no test files: 4
  • go build ./... — passed
  • git diff --check — passed

Lint/status: formatting and diff whitespace checks passed with no errors.

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes: the runtime state update RPC needs an explicit internal/runtime access boundary before it can safely mutate sandbox status/workload_id.

Comment thread internal/server/sandbox.go
@casey-brooks

Copy link
Copy Markdown
Contributor Author

Review Fix Validation Summary

Fixed Noa's requested runtime/internal access boundary in 846e1dbf5f997162045d1b132e769ce5170e64ae.

Changes:

  • Added an Istio AuthorizationPolicy for /agynio.api.agents.v1.AgentsService/UpdateSandboxRuntimeState.
  • The policy denies callers whose principal is not cluster.local/ns/{{ .Release.Namespace }}/sa/agents-orchestrator.
  • Added a regression test covering the denied user/Gateway path by asserting the runtime policy does not allow the Gateway principal.

Validation:

  • helm dependency build charts/agents — passed
  • helm lint charts/agents — passed
  • go test ./... — passed
    • packages passed: 2
    • packages failed: 0
    • packages skipped: 0
    • packages with no test files: 4
  • go build ./... — passed
  • git diff --check — passed

Lint/status: Helm lint, Go tests/build, formatting, and diff whitespace checks passed with no errors.

@noa-lucent noa-lucent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-review complete. The runtime-state access boundary is now enforced via the Agents chart AuthorizationPolicy for UpdateSandboxRuntimeState, with regression coverage, and the previous concern is resolved.

@rowan-stein
rowan-stein merged commit 5e0e179 into main Jul 24, 2026
2 checks 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 sandbox runtime state updates and restart-on-connect

3 participants