diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 21:44:41 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 21:44:41 +0000 |
| commit | 2c57f8e0b0ac637eac689a89bdf5498227b78a93 (patch) | |
| tree | d35402b9c8d3430596f0d0ab037a109059c0ce81 | |
| parent | bb599880f9b84088c2e9ffc63b1c2e0a7e9484ff (diff) | |
fix: copy .claude.json (account settings) alongside credentials
ClaudeConfigDir moved from /root/.claude to credentials/claude/, but
container.go was still deriving .claude.json from filepath.Dir which
no longer pointed anywhere useful. Claude CLI needs .claude.json for
OAuth account info or it says "Not logged in".
Also update sync-credentials to copy /root/.claude.json into the
credentials dir so it stays fresh alongside the token.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | internal/executor/container.go | 2 | ||||
| -rw-r--r-- | scripts/sync-credentials | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go index bfce750..5421108 100644 --- a/internal/executor/container.go +++ b/internal/executor/container.go @@ -161,7 +161,7 @@ func (r *ContainerRunner) Run(ctx context.Context, t *task.Task, e *storage.Exec _ = os.WriteFile(filepath.Join(agentHome, ".claude", ".credentials.json"), srcData, 0600) } // settings (used by claude CLI; copy so it can write updates without hitting the host) - if srcData, readErr := os.ReadFile(filepath.Join(filepath.Dir(r.ClaudeConfigDir), ".claude.json")); readErr == nil { + if srcData, readErr := os.ReadFile(filepath.Join(r.ClaudeConfigDir, ".claude.json")); readErr == nil { _ = os.WriteFile(filepath.Join(agentHome, ".claude.json"), srcData, 0644) } } diff --git a/scripts/sync-credentials b/scripts/sync-credentials index 78e5311..842ef34 100644 --- a/scripts/sync-credentials +++ b/scripts/sync-credentials @@ -8,11 +8,13 @@ set -euo pipefail # Source paths SOURCE_CLAUDE="/root/.claude/.credentials.json" +SOURCE_CLAUDE_SETTINGS="/root/.claude.json" SOURCE_GEMINI_OAUTH="/root/.gemini/oauth_creds.json" SOURCE_GEMINI_ACCOUNTS="/root/.gemini/google_accounts.json" # Destination paths DEST_CLAUDE="/workspace/claudomator/credentials/claude/.credentials.json" +DEST_CLAUDE_SETTINGS="/workspace/claudomator/credentials/claude/.claude.json" DEST_GEMINI_OAUTH="/workspace/claudomator/credentials/gemini/oauth_creds.json" DEST_GEMINI_ACCOUNTS="/workspace/claudomator/credentials/gemini/google_accounts.json" @@ -24,6 +26,12 @@ if [[ -f "$SOURCE_CLAUDE" ]]; then echo "Synced Claude credentials." fi +if [[ -f "$SOURCE_CLAUDE_SETTINGS" ]]; then + cp "$SOURCE_CLAUDE_SETTINGS" "$DEST_CLAUDE_SETTINGS" + chmod 644 "$DEST_CLAUDE_SETTINGS" + echo "Synced Claude settings." +fi + # Sync Gemini if [[ -f "$SOURCE_GEMINI_OAUTH" ]]; then mkdir -p "$(dirname "$DEST_GEMINI_OAUTH")" |
