Skip to content

[REMOTE-1370] Phase 2: driver-side git credential refresh#10150

Closed
jasonkeung wants to merge 2 commits intomasterfrom
jason/remote-1370-phase2
Closed

[REMOTE-1370] Phase 2: driver-side git credential refresh#10150
jasonkeung wants to merge 2 commits intomasterfrom
jason/remote-1370-phase2

Conversation

@jasonkeung
Copy link
Copy Markdown
Contributor

Description

Phase 2 of REMOTE-1370: adds the driver-side changes needed to fetch GitHub credentials at runtime and refresh them periodically, keeping long-running cloud agents authenticated for their full duration.

What:

  • New taskGitCredentials GraphQL query on the client, verified against the staging server (Phase 1 schema types)
  • New driver/git_credentials.rs module that writes ~/.git-credentials and ~/.config/gh/hosts.yaml atomically, configures git identity and credential.helper store, and provides an infinite refresh_loop future
  • fetch_secrets_and_attachments now calls taskGitCredentials in parallel with existing fetches and writes credentials + git config at startup
  • run_internal now races harness execution against the credential refresh loop via futures::select! for both the Oz and ThirdParty harness paths; the refresh future is dropped automatically when the harness completes

Why: GitHub tokens expire after 1 hour. Before this change there was no way to refresh them in a running sandbox, so any agent run longer than 1 hour lost GitHub access silently.

Note on schema.graphql: The taskGitCredentials types were added manually (not via yarn generate) because other staging schema changes were present and need separate PRs. The types were verified by running yarn generate -p staging and confirming they match exactly.

This PR should not merge until Phase 1 (warp-server) is deployed and stable.

See specs/REMOTE-1370/TECH.md in warp-server for the full design.

Linked Issue

Linear: REMOTE-1370

Testing

  • All existing tests pass (cargo nextest run --no-fail-fast -p warp)
  • cargo fmt and cargo clippy clean

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Conversation: https://staging.warp.dev/conversation/e16dc3e2-8e2f-4499-8c9b-59b200e17c50

Co-Authored-By: Oz oz-agent@warp.dev

jasonkeung and others added 2 commits May 5, 2026 11:50
Implements Phase 2 of REMOTE-1370 (refresh GitHub token at runtime)
in the warp repo:

- Add taskGitCredentials to schema.graphql and client-schema.ts, with
  types verified against the staging server
- Add task_git_credentials.rs GraphQL query (cynic), following the
  pattern of task_secrets.rs
- Add GitCredential struct and get_task_git_credentials to the AIClient
  trait with a ServerApi implementation
- Add driver/git_credentials.rs with:
  - Atomic writes to ~/.git-credentials and ~/.config/gh/hosts.yaml
  - One-time git config setup (credential.helper store, url.insteadOf)
  - Git user identity configuration from server-returned username/email
  - refresh_loop(): infinite async loop that re-fetches credentials
    every 50 minutes and overwrites the credential files
- Extend fetch_secrets_and_attachments to call taskGitCredentials in
  parallel with existing fetches; write credentials and setup git
  config at startup
- Add a futures::select! refresh loop in run_internal for both the Oz
  and ThirdParty harness paths; the refresh future is dropped when the
  harness completes

Note: schema.graphql was manually updated to add only the
taskGitCredentials types (verified against staging). Other schema
changes present on staging (VOYAGE_4_512, freeAvailableModels removal,
etc.) are intentionally excluded as they require separate PRs.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 5, 2026
@jasonkeung
Copy link
Copy Markdown
Contributor Author

Superseded by split PRs: #10152 (schema/query/API) and #10153 (driver implementation, stacked on #10152).

@jasonkeung jasonkeung closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant