Skip to content

feat(cli): support remote debugging access requests (ALIEN-831) - #645

Merged
ab-alien-dev merged 5 commits into
mainfrom
alan/alien-831-remote-debugging-support-approvals
Sep 23, 2026
Merged

ab-alien-dev merged 5 commits into
mainfrom
alan/alien-831-remote-debugging-support-approvals

Conversation

@ab-alien-dev

Copy link
Copy Markdown
Contributor

Summary

  • Add --debug-tool/--debug-namespace/--debug-cloud-scope to alien access-requests create so a single access request can authorize operations, remote debugging (kubectl/aws/gcloud/az), or both.
  • Add --access-request/--request-access/--access-duration to alien debug, so debug sessions can reuse or create the same access-request resource operations already use.
  • Regenerate the Rust SDK's openapi.json mirrors from the platform API to pick up the new debugGrant fields and other API drift.
  • Fix an unrelated ConfigureRemoteSandboxRequest field rename (imageBundleUri/maxSessionLifetimeSeconds -> maxLifetimeSeconds) surfaced by the SDK regeneration.

Companion PR in platform: unifies the same access-request system server-side (engineer/customer approval gates, debug_grant jsonb column, live-grant reuse) and updates apps/ai-agent to auto-propose debug access on debug_access_required.

Test plan

  • cargo build -p alien-cli — clean build
  • cargo test -p alien-cli --lib access_requests — 2/2 passing
  • Verified end-to-end against a live Remote Operator deployment via the ai-agent/Slack flow (see platform PR)
  • CI

@greptile-apps

greptile-apps Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with one non-blocking CLI validation issue that can silently ignore an inapplicable cloud-scope option.

Fix All in CodexFindings

  1. P2 Cloud scope is ignored ▶
Fix with agent prompt
### Issue 1
crates/alien-cli/src/commands/debug.rs:104-105
`--access-cloud-scope` is accepted without `--request-access`, but `debug_task` only reads it when creating a new request. When it is supplied with `--access-request`, the CLI silently reuses that request unchanged, which can mislead users into thinking the debug session has a narrower cloud scope. Make this option require `--request-access`, as its help text already implies.

```suggestion
    #[arg(long = "access-cloud-scope", requires = "request_access")]
    pub access_cloud_scope: Option<String>,
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR extends CLI access requests to cover remote-debugging grants, allows debug sessions to reuse or create approved access requests, and updates generated Platform API schemas.

  • Adds operation/debug grant creation, display, waiting, duration, namespace, and cloud-scope handling.
  • Passes access-request IDs into debug-session creation.
  • Updates callers for regenerated Platform API fields and model changes.
  • The latest revision addresses the prior duration and inferred-namespace findings.

Diagram

sequenceDiagram
    participant User
    participant CLI
    participant Platform
    participant Customer
    participant Manager

    User->>CLI: alien debug --request-access
    CLI->>Platform: Create debug access request
    Platform-->>CLI: Request ID
    loop Await approval
        CLI->>Platform: Get access request
        Customer->>Platform: Approve in cluster
    end
    Platform-->>CLI: Customer approved
    CLI->>Manager: Create debug session with request ID
    Manager-->>CLI: Authorized session
    CLI-->>User: Execute debug command
Loading

Reviews (2) · Last reviewed commit: "fix(cli): refresh vendored platform SDK,..."

Comment thread crates/alien-cli/src/commands/debug.rs Outdated
Comment thread crates/alien-cli/src/commands/debug.rs Outdated
ab-alien-dev added a commit that referenced this pull request Sep 17, 2026
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.
ab-alien-dev added a commit that referenced this pull request Sep 17, 2026
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.

# Conflicts:
#	crates/alien-cli/src/commands/debug.rs
@ab-alien-dev
ab-alien-dev force-pushed the alan/alien-831-remote-debugging-support-approvals branch from d8c6bb6 to fbb0976 Compare September 17, 2026 14:52
ab-alien-dev added a commit that referenced this pull request Sep 17, 2026
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.

# Conflicts:
#	crates/alien-cli/src/commands/debug.rs
@ab-alien-dev
ab-alien-dev force-pushed the alan/alien-831-remote-debugging-support-approvals branch from fbb0976 to 97b77d5 Compare September 17, 2026 15:35
ab-alien-dev added a commit that referenced this pull request Sep 19, 2026
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.

# Conflicts:
#	crates/alien-cli/src/commands/debug.rs
@ab-alien-dev
ab-alien-dev force-pushed the alan/alien-831-remote-debugging-support-approvals branch from 97b77d5 to ab8ac26 Compare September 19, 2026 17:02
ab-alien-dev added a commit that referenced this pull request Sep 21, 2026
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.

# Conflicts:
#	crates/alien-cli/src/commands/debug.rs
@ab-alien-dev
ab-alien-dev force-pushed the alan/alien-831-remote-debugging-support-approvals branch from ab8ac26 to 2e48c67 Compare September 21, 2026 17:14
Add --debug-tool/--debug-namespace/--debug-cloud-scope to `access-requests
create` and --access-request/--request-access/--access-duration to `debug`,
so a single access request can authorize operations, remote debugging
(kubectl/aws/gcloud/az), or both through Remote Operator's outbound
connection. Regenerate the Rust SDK's openapi.json mirrors from the platform
API, and fix an unrelated ConfigureRemoteSandboxRequest field rename
(imageBundleUri/maxSessionLifetimeSeconds -> maxLifetimeSeconds) surfaced by
that regeneration.
Address Greptile review on #645:
- Derive the kubectl namespace from the debugged command's -n/--namespace
  flag and submit it as debug_namespace, instead of always requesting an
  unscoped grant.
- Convert --access-duration into requested_expires_at instead of parsing
  it only to discard the result, so 30m and 1h actually produce different
  deadlines on the created access request.

# Conflicts:
#	crates/alien-cli/src/commands/debug.rs
Rebasing onto main pulled in ALIEN-818's operations-contract fields and
DeploymentSetupConfigInput's new validated_release_selection field.
Regenerates the vendored platform openapi.json/openapi-3.0.json so the
Rust SDK (progenitor, build-time codegen) picks up both; onboard.rs
doesn't have a validated release selection at onboarding time, so it
passes None for the new optional field.
@ab-alien-dev
ab-alien-dev force-pushed the alan/alien-831-remote-debugging-support-approvals branch from 2e48c67 to 3fb1dbd Compare September 21, 2026 17:40
- Re-copy platform's openapi.json into the vendored SDK mirror. It
  was copied moments before platform's own follow-up regeneration
  fix landed, so it was missing DeploymentState.registryAccess.
- Add --access-cloud-scope to `alien debug --request-access` so
  aws/gcloud/az debug grants can be scoped to a specific account/
  project/subscription, matching what kubectl already gets via
  namespace auto-derivation from the debugged command. Rejects the
  flag for kubectl (scoped by namespace instead), matching the
  manager's own debugCloudScope/debugTool compatibility rule.
Comment thread crates/alien-cli/src/commands/debug.rs Outdated
--access-cloud-scope was accepted alongside --access-request, but
debug_task only reads it when creating a NEW request via
--request-access. Supplying it with --access-request silently reused
the existing request unchanged, misleading users into thinking the
session had a narrower cloud scope than it actually does.

Reported by Greptile (#645 review comment).
@ab-alien-dev
ab-alien-dev merged commit 3ab3253 into main Sep 23, 2026
21 checks passed
@ab-alien-dev
ab-alien-dev deleted the alan/alien-831-remote-debugging-support-approvals branch September 23, 2026 06:06
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.

2 participants