Skip to content

feat(cloud-agent-next): authenticate git via a credential helper - #5336

Merged
eshurakov merged 3 commits into
mainfrom
feat/cloud-agent-git-credential-helper
Aug 27, 2026
Merged

feat(cloud-agent-next): authenticate git via a credential helper#5336
eshurakov merged 3 commits into
mainfrom
feat/cloud-agent-git-credential-helper

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR integrates Cloud Agent workspace setup with the credential-helper runtime shipped in #5445. The helper itself is not introduced here.

  • Run Cloud Agent clones through session.exec so the sandbox's enforced GIT_CONFIG_* environment reaches Git and the existing get-only helper supplies managed GitHub/GitLab/Bitbucket credentials.
  • Keep managed GitHub/GitLab/Bitbucket origin URLs canonical and credential-free across cold clone, warm workspace setup, restore, and wrapper bootstrap; refresh managed auth through the session environment instead of rewriting URLs with tokens.
  • Preserve tokenized URLs only for generic/unmanaged remotes, while keeping GitHub author configuration and Bitbucket capability URLs intact.

Test plan

  • pnpm exec vitest run src/kilo-git-credential.test.ts src/workspace.test.ts src/session-service.test.ts (192 passed)
  • bun test src/session-bootstrap.test.ts (56 passed)
  • Confirm a managed GitHub/GitLab/Bitbucket session clones with a clean origin and git ls-remote / submodule / LFS still auth via the shipped helper
  • Confirm a warm leftover tokenized origin is rewritten to the canonical URL
  • Confirm a generic git.example.com remote still clones with an embedded token
  • Confirm a DIND/devcontainer session can invoke the shipped helper through the enforced config

@kilo-code-bot
kilo-code-bot Bot force-pushed the feat/cloud-agent-git-credential-helper branch from edc789c to 7fe8224 Compare August 18, 2026 12:32
@eshurakov eshurakov self-assigned this Aug 18, 2026
Comment thread services/cloud-agent-next/scripts/kilo-git-credential Outdated
Comment thread services/cloud-agent-next/src/workspace.ts
Comment thread services/cloud-agent-next/src/session-service.ts
Comment thread services/cloud-agent-next/wrapper/src/session-bootstrap.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Per-session git-credentials file plus helper precedence fixes the stale process GH_TOKEN clone path; managed and generic remotes stay canonical.

Files Reviewed (4 files)
  • services/cloud-agent-next/scripts/kilo-git-credential
  • services/cloud-agent-next/src/kilo-git-credential.test.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts
Previous Review Summaries (2 snapshots, latest commit 6265c94)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6265c94)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Credential-helper clone wiring on the worker and wrapper is consistent: managed remotes stay credential-free, leftover type:git + platform:github PATs now populate GH_TOKEN, and prior review findings are fixed.

Files Reviewed (6 files)
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session-service.test.ts
  • services/cloud-agent-next/src/workspace.ts
  • services/cloud-agent-next/src/workspace.test.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts

Previous review

Council Review

Advisory review — findings reported, no merge decision

Specialist votes: 0 block, 4 pass. Advisory mode records these votes but does not aggregate them into a decision.

Specialist Model Highest severity Findings
Security kilo/x-ai/grok-4.6 0
Performance kilo/x-ai/grok-4.6 0
Test coverage kilo/x-ai/grok-4.6 warning 2
Correctness kilo/x-ai/grok-4.6 warning 2

Findings are counted per specialist; when specialists flag the same line their findings are grouped into one inline comment, so the inline comment count is lower than this total.
Governance mode: Advisory (report only) — the council reports findings but does not decide a merge verdict.

Code Review Summary

Status: 4 Issues Found | Recommendation: see the Council Review decision above

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/scripts/kilo-git-credential 21 Port stripping on GITLAB_HOST / requested host is untested
services/cloud-agent-next/src/session-service.ts 2629 type:git + platform:github clones without credentials
services/cloud-agent-next/wrapper/src/session-bootstrap.ts 334 Wrapper treats kind:git + platform:github as helper-backed without GH_TOKEN

SUGGESTION

File Line Issue
services/cloud-agent-next/src/workspace.ts 792 Helper-backed no-embed guard is not actually exercised
Files Reviewed (11 files)
  • services/cloud-agent-next/Dockerfile
  • services/cloud-agent-next/Dockerfile.dev
  • services/cloud-agent-next/Dockerfile.dind
  • services/cloud-agent-next/scripts/kilo-git-credential - 1 issue
  • services/cloud-agent-next/src/kilo-git-credential.test.ts
  • services/cloud-agent-next/src/session-service.test.ts
  • services/cloud-agent-next/src/session-service.ts - 1 issue
  • services/cloud-agent-next/src/workspace.test.ts
  • services/cloud-agent-next/src/workspace.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts - 1 issue

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 244.8K · Output: 15.9K · Cached: 385.2K

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov force-pushed the feat/cloud-agent-git-credential-helper branch from de8779d to bcf0d86 Compare August 24, 2026 09:32
@eshurakov
eshurakov changed the base branch from main to eshurakov/fierce-orca August 24, 2026 09:32
@eshurakov
eshurakov force-pushed the feat/cloud-agent-git-credential-helper branch from bcf0d86 to c269f69 Compare August 24, 2026 11:02
Base automatically changed from eshurakov/fierce-orca to main August 25, 2026 09:28
@eshurakov
eshurakov force-pushed the feat/cloud-agent-git-credential-helper branch 2 times, most recently from ba7ef42 to 8313fec Compare August 25, 2026 10:15
Stop embedding managed GitHub/GitLab/Bitbucket tokens in origin. A
get-only helper reads GH_TOKEN / GITLAB_TOKEN / BITBUCKET_TOKEN so
setup, submodules, and LFS work, and warm refresh is an env write.
@eshurakov
eshurakov force-pushed the feat/cloud-agent-git-credential-helper branch from 8313fec to 6265c94 Compare August 25, 2026 11:42
@eshurakov
eshurakov requested a review from pandemicsyn August 25, 2026 12:53

@pandemicsyn pandemicsyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, one inline from my robot

Comment thread services/cloud-agent-next/wrapper/src/session-bootstrap.ts Outdated
@eshurakov
eshurakov merged commit e9a371c into main Aug 27, 2026
13 checks passed
@eshurakov
eshurakov deleted the feat/cloud-agent-git-credential-helper branch August 27, 2026 08:03
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