GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mcpx): hold the artifact name claim across the delivery write (#4253) by dezren39 · Pull Request #4257 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes the never-overwrite race triaged in #4253 (task 6125, confirmed on main; fix = task 6127).

The bug: uniquePath created its O_EXCL claim file, deleted it, and returned the bare path. Store.Export (via copyInto), the exec streaming path, and fetchArtifacts (via writeNew) then finished with an overwriting os.Rename onto that path — a destination appearing in the window was silently replaced, and two concurrent same-name deliveries could both be handed the same path.

The fix: ClaimPath (replacing the racy UniquePath API) returns the destination already created, with the O_EXCL claim held open. Every delivery path writes into the claim and closes it; on failure the claimed name is removed, so nothing partial looks delivered. Writing into the claim is a copy, per the #1660 settlement — no link semantics introduced.

Tests (failing-first, class-wide per internal/AGENTS.md):

  • TestClaimPathHoldsTheNameUntilTheWriteIsDone — the exact interleaving: a second claim while the first write is in flight gets the suffixed name.
  • TestExportConcurrentSameNameDeliveriesAllSurvive — 8 concurrent same-name exports, distinct paths, own bytes.
  • TestExportKeepsAForeignFileThatHoldsTheName / TestFetchArtifactsKeepsAForeignFileThatHoldsTheName — foreign bytes preserved, delivery suffixes, recorded Path matches the file written.
  • TestDeliveryPathsHoldTheirClaims — source guard: no UniquePath references remain; the CLI delivery file must not rename onto a destination again.

CI-first: targeted package tests were not run locally (laptop under extreme load); CI results on this PR are the verification. Parked in the queue awaiting CI + Codex review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
fix(mcpx): hold the artifact name claim across the delivery write (#4253
a75465a
)

uniquePath created its O_EXCL claim, deleted it, and returned the bare
path; Store.Export (copyInto), the exec streaming path, and
fetchArtifacts (writeNew) then finished with an overwriting os.Rename.
A destination appearing in the window was silently replaced, and two
concurrent same-name deliveries could be handed the same path.

ClaimPath now returns the destination already created, with the claim
held open; every delivery path writes into the claim and closes it, and
a failure removes the claimed name so nothing partial looks delivered.
The racy UniquePath API is removed.

Tests: claim-held interleaving, concurrent same-name exports (class
width), foreign-file preservation for Export and fetchArtifacts, and a
source guard keeping the resolve-then-rename shape from returning.
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 07:18
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: cebb2a00-03cc-484f-97fc-152e5630437c
Commits

Reviewing files that changed from the base of the PR and between bf0420f and e3d1e13.

Files selected for processing: 5
  • pkgs/mcpx/internal/artifacts/artifacts.go
  • pkgs/mcpx/internal/artifacts/delivery_race_test.go
  • pkgs/mcpx/internal/artifacts/name.go
  • pkgs/mcpx/internal/cli/exec.go
  • pkgs/mcpx/internal/cli/exec_artifacts_test.go
  • 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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-02T07:51:06.905988Z e3d1e13 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 2, 2026
mcpx(artifacts): never-overwrite delivery is a check-then-rename race — uniquePath deletes its O_EXCL claim before the write, and copyInto/writeNew finish with an overwriting os.Rename #4253
Closed
@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition labels Nov 2, 2026
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 2, 2026
View reviewed changes

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

Copy link
Copy Markdown

There was a problem hiding this comment.

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: a75465a4f9

ℹ️ 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/cli/exec.go
return err
}
if err := os.Rename(w.Name(), dest); err != nil {
if _, err := w.Seek(0, io.SeekStart); err != nil {

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 2, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Keep the staged artifact open until the copy finishes

When a streamed artifact has received a data frame, FrameArtifactEnd closes w at line 309 before this new seek, so w.Seek always returns file already closed. Consequently, execRemoteStream aborts on the first such artifact instead of delivering it or processing the remaining frames. Keep the staged file open through the seek and copy, then close and remove it afterward. The existing TestApplyFrameSameNamedArtifactsNeverOverwrite exercises this path, although local execution was blocked by the installed Go 1.25.1 being older than the required Go 1.27.2.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dezren39 dezren39 Nov 2, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixed in e3d1e13: applyFrame keeps the staged temp file open through Seek and io.Copy, then closes it and removes the staging path. The streaming regression, full artifacts/CLI package suite, and delivery tests under -race -shuffle=on -count=5 all pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39 dezren39 added queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) labels Nov 2, 2026
dezren39 added 2 commits November 2, 2026 01:47
@dezren39
Merge remote-tracking branch 'origin/main' into queue/6127-4253-artif…
687af0e
…act-claim
@dezren39
fix(mcpx): keep streamed artifact staging file open (#4253)
e3d1e13
@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review Please re-review head e3d1e13, especially the previously reported P1 on closing the streamed artifact staging file before seeking/copying.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026

Copy link
Copy Markdown

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

Reviewed commit: e3d1e1301e

ℹ️ 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".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition and removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Nov 2, 2026
@dezren39
dezren39 merged commit c1bc2b2 into main Nov 2, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/6127-4253-artifact-claim branch November 2, 2026 08:12
@dezren39 dezren39 removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) work/assigned Queue worker lifecycle state labels Nov 2, 2026
@dezren39
dezren39 restored the queue/6127-4253-artifact-claim branch November 8, 2026 04:21
@developing-today

developing-today Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

agent-note:v1 — salvage note from task 13544 (lane code-k) closing duplicate PR #7242. File-by-file diff of PR #7242 head e3d1e13 vs current main: name.go and exec_artifacts_test.go identical; delivery_race_test.go on main differs only by a later lint cleanup; artifacts.go and cli/exec.go diffs are main-side advances (RandSource, idleTTL naming, dryRun/depsOptions/imports flags) that PR #7242 would revert. PR #7242 first commit landed via this PR #4257 (merged); its unique commit e3d1e13 (keep streamed artifact staging file open) is present on main in evolved form (exec.go stagedPath line ~309, claim.Close ~335-349). Verdict: nothing unique to salvage from PR #7242.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@developing-today developing-today Bot mentioned this pull request Nov 8, 2026
fix(mcpx): keep streamed artifact staging file open (#4253) #7242
Closed
@dezren39
dezren39 deleted the queue/6127-4253-artifact-claim branch November 9, 2026 13:17
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.