fix(control-plane): credential session unblock + project namespace cleanup + CLI credential verbs#1181
Merged
markturansky merged 4 commits intoalphafrom Apr 3, 2026
Conversation
…ovision namespace on project delete - Drop ensureCredentialRoleBindings from kube_reconciler: runner authenticates via BOT_TOKEN (control-plane JWT), not K8s SA token, so binding a non-existent credential:token-reader ClusterRole served no purpose and blocked session start - Fix project_reconciler EventDeleted to call DeprovisionNamespace instead of logging "namespace retained for safety" no-op 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds `credentials` as a valid resource type for `acpctl get`, `acpctl delete`, and `acpctl describe`, alongside existing verbs. Aliases: credential, cred, creds. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds `kind: Credential` handling to `acpctl apply -f / -k`. Supports create and patch semantics (created/configured/unchanged). Token field expands env vars ($VAR syntax) matching spec usage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- acpctl agent start now supports -o json returning the session object - demo-github.sh: GitHub credential end-to-end demo script 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds credential management capabilities to the Ambient CLI through Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as acpctl<br/>(Demo Script)
participant CP as Control Plane<br/>(API)
participant K8s as Kubernetes
participant Agent as Ambient Agent
User->>CLI: demo-github.sh with GITHUB_TOKEN
CLI->>CP: Create project
CP-->>CLI: Project created
CLI->>CP: Create agent
CP-->>CLI: Agent created
CLI->>CP: Create GitHub credential
CP-->>CLI: Credential created
CLI->>CP: Get credential:reader role ID
CP-->>CLI: Role ID
CLI->>CP: Create role-binding (user → credential:reader)
CP-->>CLI: Binding created
CLI->>CP: Start agent session<br/>(with prompt)
CP->>K8s: Deploy session pod<br/>(with CREDENTIAL_IDS env)
K8s->>Agent: Launch container
CP-->>CLI: Session ID
CLI->>CP: Poll session phase
loop Until Running
CP-->>CLI: Phase status
end
CLI->>CP: Stream session messages
loop Until RUN_FINISHED/RUN_ERROR
Agent->>CP: Send execution updates
CP-->>CLI: Message stream
end
CLI->>CP: Stop session
CLI->>CP: Delete credential
CLI->>CP: Delete project
CP-->>CLI: Cleanup complete
CLI-->>User: Demo results & cleanup summary
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensureCredentialRoleBindingsfromkube_reconciler.go— this was creating K8sRoleBindingobjects referencing a non-existentcredential:token-readerClusterRole, blocking session provisioning. The runner authenticates viaBOT_TOKEN(control-plane JWT injected as a secret), not K8s SA token, so the binding was vestigial and served no purpose.project_reconciler.goEventDeletednow callsDeprovisionNamespaceinstead of logging "namespace retained for safety" (was a deliberate no-op that was never wired up).credentialsinto genericacpctl get/delete/describeverbs (was returning "unknown resource type").kind: Credentialsupport toacpctl apply.-o jsontoacpctl agent start.demo-github.sh— end-to-end GitHub credential demo script alongsidedemo-kind.sh.Test plan
clusterroles.rbac.authorization.k8s.io "credential:token-reader" not foundacpctl get credentials/acpctl describe credential <id>/acpctl delete credential <id>work as generic verbsacpctl applywith akind: CredentialYAML creates/patches the credentialacpctl agent start <agent> -o jsonreturns JSON session object./components/ambient-cli/demo-github.shruns end-to-end with a GitHub PAT🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
--output/-o) for agent start commandImprovements