diff --git a/Cargo.lock b/Cargo.lock index 896db78b..c3d303d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4618,6 +4618,18 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "sylpheed-export" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "image", + "serde", + "serde_json", + "sylpheed-formats", +] + [[package]] name = "sylpheed-formats" version = "0.1.0" diff --git a/docker/decoder/entrypoint.sh b/docker/decoder/entrypoint.sh index f14b94de..da5ce0e5 100755 --- a/docker/decoder/entrypoint.sh +++ b/docker/decoder/entrypoint.sh @@ -133,13 +133,23 @@ mkdir -p /exchange/files 2>/dev/null || true # Seeded rather than shared because credentials live in .credentials.json and a # token refresh must be able to write. Copying once means each agent refreshes # its own token and neither can corrupt the host's. -if [ -d "$HOME/.claude.seed" ] && [ ! -s "$HOME/.claude/.credentials.json" ]; then +# Re-seed whenever the HOST's credentials are newer than ours, not only when +# ours are missing. The missing-only guard meant an expired token could never be +# replaced: the file existed, so the copy was skipped, and restarting the +# container changed nothing. A human re-logging in on the host is exactly the +# recovery path, and it has to reach here. +# +# Newer-wins rather than always-copy, because the container refreshes its own +# token during a run and that copy may legitimately be the fresher one. +if [ -d "$HOME/.claude.seed" ] && \ + { [ ! -s "$HOME/.claude/.credentials.json" ] || \ + [ "$HOME/.claude.seed/.credentials.json" -nt "$HOME/.claude/.credentials.json" ]; }; then mkdir -p "$HOME/.claude" cp -a "$HOME/.claude.seed/.credentials.json" "$HOME/.claude/" 2>/dev/null || true for f in settings.json CLAUDE.md; do [ -e "$HOME/.claude.seed/$f" ] && cp -a "$HOME/.claude.seed/$f" "$HOME/.claude/" 2>/dev/null || true done - echo "[entrypoint] seeded ~/.claude from the host (credentials only)" + echo "[entrypoint] refreshed ~/.claude credentials from the host" fi # Seed ~/.claude.json from the host's read-only copy, then stamp onboarding as diff --git a/docker/port/entrypoint.sh b/docker/port/entrypoint.sh index 0cd71feb..8fa94dcc 100755 --- a/docker/port/entrypoint.sh +++ b/docker/port/entrypoint.sh @@ -30,13 +30,23 @@ echo "[entrypoint] display $DISPLAY ready ($SCREEN_GEOMETRY)" # Seeded rather than shared because credentials live in .credentials.json and a # token refresh must be able to write. Copying once means each agent refreshes # its own token and neither can corrupt the host's. -if [ -d "$HOME/.claude.seed" ] && [ ! -s "$HOME/.claude/.credentials.json" ]; then +# Re-seed whenever the HOST's credentials are newer than ours, not only when +# ours are missing. The missing-only guard meant an expired token could never be +# replaced: the file existed, so the copy was skipped, and restarting the +# container changed nothing. A human re-logging in on the host is exactly the +# recovery path, and it has to reach here. +# +# Newer-wins rather than always-copy, because the container refreshes its own +# token during a run and that copy may legitimately be the fresher one. +if [ -d "$HOME/.claude.seed" ] && \ + { [ ! -s "$HOME/.claude/.credentials.json" ] || \ + [ "$HOME/.claude.seed/.credentials.json" -nt "$HOME/.claude/.credentials.json" ]; }; then mkdir -p "$HOME/.claude" cp -a "$HOME/.claude.seed/.credentials.json" "$HOME/.claude/" 2>/dev/null || true for f in settings.json CLAUDE.md; do [ -e "$HOME/.claude.seed/$f" ] && cp -a "$HOME/.claude.seed/$f" "$HOME/.claude/" 2>/dev/null || true done - echo "[entrypoint] seeded ~/.claude from the host (credentials only)" + echo "[entrypoint] refreshed ~/.claude credentials from the host" fi # Seed ~/.claude.json from the host's read-only copy, then stamp onboarding as