Skip to content

fix(core): run state sync before docker compose up to prevent broken bind mounts#159

Closed
konard wants to merge 3 commits intoProverCoderAI:mainfrom
konard:issue-158-d548e00afaff
Closed

fix(core): run state sync before docker compose up to prevent broken bind mounts#159
konard wants to merge 3 commits intoProverCoderAI:mainfrom
konard:issue-158-d548e00afaff

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 18, 2026

Summary

Fixes #158

  • Root cause: autoSyncState() ran after docker compose up, performing git reset --hard which replaces directory inodes. The bind mount for .orch/auth/codex/home/dev/.codex then pointed to a deleted inode, leaving the container with an empty CODEX_HOME.
  • Symptom: codex inside the container fails with Error loading configuration: No such file or directory
  • Fix: Move autoSyncState() to run before runDockerUpIfNeeded() so bind mount source directories are stable when the container starts.

Математические гарантии

Инварианты:

  • ∀ bind_mount ∈ DockerCompose: source_inode(bind_mount) = stable_inode (bind mount sources must not be replaced after container start)
  • autoSyncState(msg) → state_synced(msg) ∧ ¬container_running (state sync completes before any container starts)

Предусловия:

  • Project files prepared via prepareProjectFiles()
  • Docker daemon accessible

Постусловия:

  • ∀ codex_container: /home/dev/.codex/config.toml exists ∧ readable

Test plan

  • TypeScript typecheck passes (pnpm run check)
  • All 81 unit tests pass (pnpm test in packages/lib)
  • Manual verification: docker-git clone <repo> --force → codex starts without "No such file or directory" error

This PR was created by the AI issue solver

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#158
@konard
Copy link
Contributor Author

konard commented Mar 18, 2026

🚨 Solution Draft Failed

The automated solution draft encountered an error:

CLAUDE execution failed

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Main model: Claude Opus 4.6 (ID: claude-opus-4-6, Anthropic, cutoff: 2025-05)
    📎 Failure log uploaded as Gist (108KB)
    🔗 View complete failure log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@skulidropek skulidropek marked this pull request as ready for review March 18, 2026 13:26
@konard konard marked this pull request as draft March 18, 2026 16:39
@konard
Copy link
Contributor Author

konard commented Mar 18, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-03-18T16:39:11.895Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

…bind mounts

autoSyncState does git-reset-hard which replaces directory inodes on disk.
When it ran after docker compose up, the bind mount for .orch/auth/codex
(mounted as /home/dev/.codex) pointed to a deleted inode, leaving the
container with an empty CODEX_HOME directory.

This caused codex inside the container to fail with:
  "Error loading configuration: No such file or directory"

Moving autoSyncState before runDockerUpIfNeeded ensures bind mount source
directories are stable before the container starts.

Fixes ProverCoderAI#158

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Исправить: fix(core): run state sync before docker compose up to prevent broken bind mounts Mar 18, 2026
@konard konard marked this pull request as ready for review March 18, 2026 16:43
@konard
Copy link
Contributor Author

konard commented Mar 18, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.637472
  • Calculated by Anthropic: $2.168108 USD
  • Difference: $-1.469364 (-40.40%)

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Main model: Claude Opus 4.6 (ID: claude-opus-4-6, Anthropic, cutoff: 2025-05)
    📎 Log file uploaded as Gist (983KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 18, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

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