Skip to content

feat(cli): add access-requests revoke and the revoked grant state (ALIEN-1135) - #820

Merged
lilienblum merged 4 commits into
mainfrom
dan/alien-1135-access-requests-link-approval-to-operations-and-results-and
Oct 1, 2026
Merged

lilienblum merged 4 commits into
mainfrom
dan/alien-1135-access-requests-link-approval-to-operations-and-results-and

Conversation

@lilienblum

@lilienblum lilienblum commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Implements the CLI side of ALIEN-1135. Merge this first; the Platform API change depends on it.

What changes for the user

  • alien access-requests revoke <id> [--reason <text>] withdraws a pending, queued or approved request. Operations still waiting to be dispatched fail, open debug sessions stop, and operations already running finish. Revoking twice returns the same request. An expired or rejected request is refused with the API's ACCESS_REQUEST_NOT_REVOCABLE message.
  • alien access-requests wait and the --request-access shortcuts treat a revoked request as closed, the same as rejected or expired.
  • get --json adds agentSessionId, createdAt, queuedBy, queuedAt, approvedBy, deniedBy and revokedBy. revoke --json prints the whole API response, as wait --json already does. get and revoke print who revoked a request and why.
  • The access-request CRD's status.state description lists REVOKED. The control plane's loop writes it when a grant is revoked; the OSS operator still never acts on the CR status.

What the next maintainer inherits

  • client-sdks/platform/openapi.json, rust/openapi.json and rust/openapi-3.0.json are the current Platform API contract, copied by the Platform API generation pipeline. Nothing is hand-edited. Besides the revoke and activity operations, the copy brings the spec up to date in five operations and three schemas. One of those removes catalogImage from the Azure half of the Remote Sandbox settings, so tests/remote_sandbox_azure_registry_image.rs no longer asserts on that field.
  • The TypeScript SDK is not regenerated here. It was already behind the checked-in spec on main, and nothing in this change uses it. Regenerating it with pnpm run generate:platform-api (Speakeasy 1.799.0) belongs in its own SDK-sync PR, as client-sdks/AGENTS.md asks.
  • REQUIRED_OPERATION_IDS gains revokeAccessRequest only. getAccessRequestActivity has no Rust consumer in this repository, so it stays out of the filtered client. The filtered client is about 214,000 lines, under MAX_FILTERED_GENERATED_LINES.
  • AccessRequestStatus::Revoked is in the generated enum. An older CLI fails closed decoding it in get and wait.
  • crates/alien-cli/src/commands/access_requests.rs: approval_outcome() decides whether a status is approved, closed or pending. wait, wait_for_approval and operations invoke --request-access all use it.

Verification

  • cargo test -p alien-platform-api: the filter keeps exactly the listed operations, and the Remote Sandbox and unknown-field decode tests pass against the new spec.
  • cargo test -p alien-cli --lib access_requests: revoke parses with and without --reason; against a loopback API it sends { "reason": … } or {} with the workspace, accepts a revoked response, and surfaces the API message on 404 and 409; approval_outcome is checked for every status.
  • cargo fmt --check.

…IEN-1135)

Regenerate the Platform API spec copies and SDKs from the Platform API
that adds POST /v1/access-requests/{id}/revoke, GET /{id}/activity, the
revoked status, the per-request decision records and the command link.

alien access-requests revoke <id> [--reason] withdraws a request; wait
treats a revoked request as closed. The CRD status description lists
REVOKED, which the operator writes when the control plane revokes a
grant.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T12:23:34.920806Z 1666b0f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Adds revoke operation to access request API and state machine.

The PR appears safe to merge; no outstanding previous finding or actionable new issue was identified.

Summary

The PR adds access-request revocation to the CLI, treats revoked requests as closed in approval waits, and updates the Rust API contract and CRD description.

  • The changes since the previous review restore the TypeScript SDK, complete the CLI provenance output, and remove an unused Rust activity operation.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["revoke command"] --> API["Platform revoke API"]
  API --> Revoked["Revoked request"]
  Revoked --> Wait["wait and request-access shortcuts: closed"]
  Revoked --> CR["Control plane reports revoked ID for grant CR status"]
Loading

Reviews (2) · Last reviewed commit: "chore(platform-sdk): refresh the Platfor..."

Comment thread crates/alien-cli/src/commands/access_requests.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1666b0f058

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client-sdks/platform/typescript/src/models/configureremotesandboxrequest.ts Outdated
Comment thread client-sdks/platform/rust/build/openapi_filter.rs Outdated
…revoke change

The Platform TypeScript SDK is regenerated by generate:platform-api with
its pinned Speakeasy version, and nothing in this change consumes it, so
it goes back to its state on main. The spec copies and the Rust client
inputs stay.

The refreshed spec no longer has an Azure catalogImage on the Remote
Sandbox settings, so the Rust decode test stops asserting on that field.
…ctivity client

get --json adds agentSessionId, createdAt, queuedBy, queuedAt, approvedBy,
deniedBy and revokedBy; revoke --json prints the whole response, as wait
--json does. get also prints who revoked a request and why.

No Rust consumer calls getAccessRequestActivity, so it leaves the filtered
client's operation list.
Two descriptions changed: the debug-session access request link and the
revoked request ids the operator pulls.
@lilienblum

Copy link
Copy Markdown
Contributor Author

@greptile review

@lilienblum
lilienblum merged commit 47ec725 into main Oct 1, 2026
22 checks passed
@lilienblum
lilienblum deleted the dan/alien-1135-access-requests-link-approval-to-operations-and-results-and branch October 1, 2026 15:01
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.

1 participant