Skip to content

Conversation

@squinlan-oai
Copy link
Contributor

Summary

  • add a shared git-ref resolver and use it for codex cloud exec and TUI task submission
  • expose a new --branch flag to override the git ref passed to cloud tasks
  • cover the git-ref resolution behavior with new async unit tests and supporting dev dependencies

Testing

  • cargo test -p codex-cloud-tasks

Codex Task

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@squinlan-oai
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 1, 2025
@squinlan-oai squinlan-oai marked this pull request as ready for review December 1, 2025 22:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds branch override functionality for cloud-executed tasks, allowing users to specify a custom git reference via a --branch flag. The implementation introduces a shared git reference resolver that consolidates duplicate logic previously used in both codex cloud exec and TUI task submission.

Key Changes:

  • Introduced a resolve_git_ref function with testable abstraction for git operations
  • Added --branch flag to the ExecCommand CLI
  • Replaced duplicate git reference resolution logic with the new shared function

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
codex-rs/cloud-tasks/src/lib.rs Adds GitInfoProvider trait, resolve_git_ref functions, updates run_exec_command to use branch override, refactors TUI submission to use shared resolver, and adds comprehensive unit tests
codex-rs/cloud-tasks/src/cli.rs Adds optional --branch parameter to ExecCommand struct
codex-rs/cloud-tasks/Cargo.toml Moves async-trait from dev-dependencies to regular dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@tamird tamird left a comment

Choose a reason for hiding this comment

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

Could you please give me some context? I'm not sure why I was chosen as a reviewer for this PR. Thanks!

@squinlan-oai
Copy link
Contributor Author

@tamird github thought you were relevant.

@tamird
Copy link
Contributor

tamird commented Dec 2, 2025

It thought wrong!

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@etraut-openai
Copy link
Collaborator

@squinlan-oai, PR has been reviewed and approved. Please address the merge conflicts, and then it should be ready.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Dec 8, 2025
Comment on lines 136 to 138
if let Some(branch) = git_info.default_branch_name(&cwd).await {
branch
} else if let Some(branch) = git_info.current_branch_name(&cwd).await {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should probably be the other way around? i.e. current branch first, otherwise default branch, otherwise "main"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@codex address this + fix any build errors

Copy link
Contributor

Choose a reason for hiding this comment

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

Codex couldn't complete this request. Try again later.

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Dec 9, 2025
@nornagon-openai nornagon-openai changed the title Add branch override for cloud exec git reference cloud: default to current branch in cloud exec Dec 18, 2025
@nornagon-openai nornagon-openai enabled auto-merge (squash) December 18, 2025 17:28
@nornagon-openai nornagon-openai merged commit 425c8dc into main Dec 18, 2025
26 checks passed
@nornagon-openai nornagon-openai deleted the codex/update-codex-cloud-exec-for-git-ref branch December 18, 2025 17:44
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants