Skip to content

workspace: keep the maiden-run marker on the workspace volume - #4

Open
rkb32 wants to merge 1 commit into
mainfrom
fix-setup-marker-minimal
Open

rkb32 wants to merge 1 commit into
mainfrom
fix-setup-marker-minimal

Conversation

@rkb32

@rkb32 rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Fixes google#518. The maiden-run marker lived under /ax, which a volumes-only resume does not restore, so setup reran and could overwrite the agent's edits. The marker now lives on the workspace volume: .git/.ax/initialized for a Git repo, otherwise .ax/initialized. A marker left under /ax by an earlier version is migrated.

Tests: internal/workspace, runner, and test/e2e pass on Linux. On Windows, TestMarkerName fails; that is pre-existing and not changed here.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 78c861df-c444-4efb-b443-d4950d0a1276
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T00:14:15.690295Z 6a39594 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58919753ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +280 to +283
if info, err := os.Lstat(filepath.Join(targetPath, ".git")); err == nil && info.IsDir() {
return filepath.Join(targetPath, ".git", markerDirName, InitializedMarkerFilename)
}
return filepath.Join(targetPath, markerDirName, InitializedMarkerFilename)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the marker path stable for root Git clones

When a workspace clones a repository into dir: ".", workspaceMarkerPath is evaluated before cloneRepos, while .git is still absent, so the first run writes <workspace>/.ax/initialized. On the next runner start, .git exists and this helper switches to <workspace>/.git/.ax/initialized, misses the marker, and reruns setup; fetchRepo then uses git checkout -f FETCH_HEAD, which resets tracked edits. Keep the marker path stable across the clone.

Useful? React with 👍 / 👎.

}

markerPath := filepath.Join(AXDir, MarkerName(targetPath))
markerPath := workspaceMarkerPath(targetPath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the E2E assertion to the workspace marker path

For the root-clone fixture in TestE2E_WorkspaceSetup_FilesAndGit, this code writes the marker under /workspace/primary/.ax/initialized, but the test still checks /ax/initialized-workspace-primary and requires MARKERS_OK; that E2E test will fail. Update the assertion to match the new marker location.

AGENTS.md reference: AGENTS.md:L105-L106

Useful? React with 👍 / 👎.

@rkb32

rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58919753ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if info, err := os.Lstat(filepath.Join(targetPath, ".git")); err == nil && info.IsDir() {
return filepath.Join(targetPath, ".git", markerDirName, InitializedMarkerFilename)
}
return filepath.Join(targetPath, markerDirName, InitializedMarkerFilename)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid overwriting a declared workspace file

When a workspace has no root Git repository and declares a file at .ax/initialized, writeFiles writes the user's content before writeMarker replaces that path with marker data. Workspace validation permits this path, so setup silently corrupts the declared file; use a non-conflicting marker path or reject the collision.

Useful? React with 👍 / 👎.

@rkb32

rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: cb287f1a88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rkb32

rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: cb287f1a88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rkb32

rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 5ad301b417

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rkb32

rkb32 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 6a3959414a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rkb32

rkb32 commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6a3959414a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…#518)

The marker lived under /ax, which a volumes-only resume does not restore, so
setup reran and could overwrite the agent's edits. Write it under the
workspace instead: .git/.ax/initialized for a Git repo, otherwise
.ax/initialized. Migrate a legacy marker only when it names this workspace.
Refuse a marker path that is a symbolic link. Keep an existing inlined file
on a rerun. Make MarkerName portable across path separators. Check the marker
path in the E2E test and in the runner test.
@rkb32
rkb32 force-pushed the fix-setup-marker-minimal branch from c9a8642 to ffb4b43 Compare November 2, 2026 17:26
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.

Workspace maiden-run marker under /ax is lost on volumes-only resume

1 participant