Skip to content

Add the publish_source agent tool - #252

Merged
nishu-builder merged 1 commit into
codex/publish-cli-20260917-911f8baefrom
codex/publish-agent-20260917-911f8bae
Sep 18, 2026
Merged

nishu-builder merged 1 commit into
codex/publish-cli-20260917-911f8baefrom
codex/publish-agent-20260917-911f8bae

Conversation

@nishu-builder

@nishu-builder nishu-builder commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Add publish_source(source_tree, repository, branch). Persist the selected commit, destination and expected remote head before pushing. Every resumed attempt can send that same pinned intent, without substituting newer source edits or refreshing the lease.

Pass definite rejection reasons through to the model. After a conflict or uncertain result, inspect the remote: the intended commit confirms success, including when Git retries after losing an acknowledgement and reports a stale lease. Keep source integration and publication policy in the agent.

Regression coverage preserves the first pin through competing observations, source edits, lost acknowledgement and restart, and checks convergence after a rejected HTTP retry.

Validation on EC2: Nix build passed. The salted suite passed 46/47 checks in 395s; its Clippy findings were fixed, and Clippy passed on all affected crates with --all-targets -- -D warnings. Formatting passed after those lint-only fixes. HTTPS import/push, shallow-locator/offline-cache, and focused unit checks also passed. The functional suite was not repeated for the lint-only changes.

@nishu-builder nishu-builder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Layer 5/8. The pin-before-push structure is right: intent (H, E, repo, branch) is appended atomically with the ToolStart under the call's durable identity, a later source edit does not move the pinned head (the unit test checks exactly that, including after restart), and moving Outcome into conversation-protocol removes a copy from caos-cli.

One finding I would fix before merging, inline at the if fresh branch: the comment says concurrent attempts may send the pinned push and converge on the lease, but only the pin winner ever pushes. A second attempt that observes the branch while the first push is in flight records Uncertain first, and the winner's Complete is then dropped by finish. Since the push is idempotent under the exact lease, letting non-fresh attempts send the same pinned request is the simplest fix and is what the design already describes.

Second inline comment: the _ => arm after command.output() treats every non-zero caos push-git exit, including 400s and local usage errors, as "recovered by observation", which reports uncertainty for calls that never reached the server.


Generated by Claude Code

Comment thread std/llm-step/src/publish_source.rs Outdated
Comment thread std/llm-step/src/publish_source.rs Outdated
@nishu-builder
nishu-builder force-pushed the codex/publish-agent-20260917-911f8bae branch 2 times, most recently from a801ccd to d251500 Compare September 18, 2026 00:48
@nishu-builder
nishu-builder force-pushed the codex/publish-agent-20260917-911f8bae branch from d251500 to dd7c811 Compare September 18, 2026 01:12
@nishu-builder
nishu-builder removed this pull request from stack #255 September 18, 2026 07:50
@nishu-builder
nishu-builder added this pull request to stack #257 September 18, 2026 07:51
@nishu-builder
nishu-builder force-pushed the codex/publish-agent-20260917-911f8bae branch from dd7c811 to b20eba2 Compare September 18, 2026 10:52
@nishu-builder
nishu-builder removed this pull request from stack #257 September 18, 2026 10:52
@nishu-builder
nishu-builder added this pull request to stack #257 September 18, 2026 10:52
@nishu-builder
nishu-builder removed this pull request from stack #257 September 18, 2026 10:53
@nishu-builder
nishu-builder added this pull request to stack #261 September 18, 2026 10:53
@nishu-builder
nishu-builder force-pushed the codex/publish-agent-20260917-911f8bae branch from b20eba2 to 1f763b2 Compare September 18, 2026 19:52
@nishu-builder
nishu-builder merged commit ae41879 into main Sep 18, 2026
2 checks passed
@nishu-builder
nishu-builder deleted the codex/publish-agent-20260917-911f8bae branch September 18, 2026 20:07
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.

1 participant