Repository navigation
Description
What should be improved?
Sandbox sessions provision git credentials but never git identity. An external agent can clone, fetch, and push on its session grant, yet its first git commit fails with Author identity unknown unless identity happens to exist in container-local state — which does not survive sandbox recreation (HOME is ephemeral; only the /user volume persists).
Current behavior
services/platform/convex/node_only/sandbox/session_credentials.ts:128-130injects exactly one config pair via env —GIT_CONFIG_KEY_0=credential.helper→/usr/local/bin/tale-git-credential— when a git grant is present. Credentials only.- No other layer writes identity: no
git configin the runtime image or its entrypoints/daemon (services/sandbox-runtime/), no~/.gitconfigin a fresh container, noGIT_AUTHOR_*env. - Observed live while an agent authored feat(platform): let external agents call granted workspace tools #2585:
git commit→fatal: unable to auto-detect email address/ "Author identity unknown"; the agent had to infer an identity fromgit logand hand-set repo-local config. - Side effect: Claude Code's
Git user:context line (rendered fromgit config user.nameat conversation start) shows a stale value from an earlier container incarnation — or nothing — instead of a provisioned fact.
Proposed change
Inject the session owner's identity at the same point the credential helper is injected — two more GIT_CONFIG_* pairs resolved from the platform user who owns the session:
GIT_CONFIG_COUNT=3
GIT_CONFIG_KEY_1=user.name GIT_CONFIG_VALUE_1=<owner name/login>
GIT_CONFIG_KEY_2=user.email GIT_CONFIG_VALUE_2=<owner email>
Env-injected like the helper, so it needs no in-session git config exec, survives container recreation deterministically, and never touches the persistent volume. Plausibly gated on the same git.length > 0 condition; always-on is also defensible so the CLI's Git user: line is deterministic even without a git grant.
Affected service
Sandbox (injection code lives in the platform service: convex/node_only/sandbox/session_credentials.ts).
Acceptance criteria
- A fresh sandbox session with a git grant can
git commitwith no manualgit config; the author is the session owner's platform identity. - Identity survives sandbox stop/recreate (per-session env, not container state).
- Claude Code's
Git user:context line reflects the injected identity in a fresh container. - Covered by a test beside the existing credential-helper injection coverage for
session_credentials.ts.
Related: #2585 (PR whose authoring hit this gap).
Activity