feat: rebrand from openai/codex to just-every/coder

- Update GitHub Actions workflow for version handling
- Change command references from 'codex' to 'coder'
- Improve release script with better version validation
- Update browser mode UI displays
- Update repository references and branding

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit is contained in:
James Peter
2025-08-12 22:51:50 +10:00
co-authored by Claude
parent 0387e602ad
commit aefd1e5706
10 changed files with 275 additions and 46 deletions
+31 -15
View File
@@ -18,10 +18,13 @@ concurrency:
jobs:
tag-check:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Validate tag matches Cargo.toml version
- name: Validate tag format and extract version
id: extract
shell: bash
run: |
set -euo pipefail
@@ -33,16 +36,12 @@ jobs:
[[ "${GITHUB_REF_NAME}" =~ ^rust-v[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)(\.[0-9]+)?)?$ ]] \
|| { echo "❌ Tag '${GITHUB_REF_NAME}' doesn't match expected format"; exit 1; }
# 2. Extract versions
# 2. Extract version from tag
tag_ver="${GITHUB_REF_NAME#rust-v}"
cargo_ver="$(grep -m1 '^version' codex-rs/Cargo.toml \
| sed -E 's/version *= *"([^"]+)".*/\1/')"
# 3. Compare
[[ "${tag_ver}" == "${cargo_ver}" ]] \
|| { echo "❌ Tag ${tag_ver} ≠ Cargo.toml ${cargo_ver}"; exit 1; }
echo "✅ Tag and Cargo.toml agree (${tag_ver})"
echo "version=${tag_ver}" >> $GITHUB_OUTPUT
echo "✅ Tag format valid: ${GITHUB_REF_NAME}"
echo "📦 Version to build: ${tag_ver}"
echo "::endgroup::"
build:
@@ -75,6 +74,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version in Cargo.toml
shell: bash
run: |
VERSION="${{ needs.tag-check.outputs.version }}"
echo "📝 Updating version to ${VERSION} in Cargo.toml"
# Update the workspace version
sed -i.bak "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
# Verify the update
echo "Updated Cargo.toml:"
grep "^version = " Cargo.toml
# Update Cargo.lock to reflect the new version
cargo update --workspace
- uses: dtolnay/[email protected]
with:
targets: ${{ matrix.target }}
@@ -95,7 +111,7 @@ jobs:
sudo apt install -y musl-tools pkg-config
- name: Cargo build
run: cargo build --target ${{ matrix.target }} --release --bin codex
run: cargo build --target ${{ matrix.target }} --release --bin coder
- name: Stage artifacts
shell: bash
@@ -104,9 +120,9 @@ jobs:
mkdir -p "$dest"
if [[ "${{ matrix.runner }}" == windows* ]]; then
cp target/${{ matrix.target }}/release/codex.exe "$dest/codex-${{ matrix.target }}.exe"
cp target/${{ matrix.target }}/release/coder.exe "$dest/coder-${{ matrix.target }}.exe"
else
cp target/${{ matrix.target }}/release/codex "$dest/codex-${{ matrix.target }}"
cp target/${{ matrix.target }}/release/coder "$dest/coder-${{ matrix.target }}"
fi
- name: Compress artifacts
@@ -119,8 +135,8 @@ jobs:
# For compatibility with environments that lack the `zstd` tool we
# additionally create a `.tar.gz` alongside every single binary that
# we publish. The end result is:
# codex-<target>.zst (existing)
# codex-<target>.tar.gz (new)
# coder-<target>.zst (existing)
# coder-<target>.tar.gz (new)
# 1. Produce a .tar.gz for every file in the directory *before* we
# run `zstd --rm`, because that flag deletes the original files.
+1 -1
View File
@@ -22,7 +22,7 @@ pub(crate) async fn chatgpt_get_request<T: DeserializeOwned>(
get_chatgpt_token_data().ok_or_else(|| anyhow::anyhow!("ChatGPT token not available"))?;
let account_id = token.account_id.ok_or_else(|| {
anyhow::anyhow!("ChatGPT account ID not available, please re-run `codex login`")
anyhow::anyhow!("ChatGPT account ID not available, please re-run `coder login`")
});
let response = client
+50 -12
View File
@@ -2,19 +2,22 @@
set -euo pipefail
# By default, this script uses a version based on the current date and time.
# If you want to specify a version, pass it as the first argument. Example:
# This script creates a GitHub release by tagging the current commit.
# The GitHub Actions workflow will handle updating the version in Cargo.toml during build.
#
# Usage:
# ./scripts/create_github_release.sh 0.1.0
# ./scripts/create_github_release.sh 0.1.0-alpha.4
#
# The value will be used to update the `version` field in `Cargo.toml`.
# If no version is specified, a timestamp-based version will be used.
# Change to the root of the Cargo workspace.
cd "$(dirname "${BASH_SOURCE[0]}")/.."
# Change to the root of the repository (two levels up from scripts dir).
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
# Cancel if there are uncommitted changes.
if ! git diff --quiet || ! git diff --cached --quiet || [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "ERROR: You have uncommitted or untracked changes." >&2
echo " Please commit or stash your changes before creating a release." >&2
exit 1
fi
@@ -35,7 +38,7 @@ fi
# Ensure the current local commit on 'main' is present on 'origin/main'.
# This guarantees we only create releases from commits that are already on
# the canonical repository (https://github.com/openai/codex).
# the canonical repository.
if ! git fetch --quiet origin main; then
echo "ERROR: Failed to fetch 'origin/main'. Ensure the 'origin' remote is configured and reachable." >&2
exit 1
@@ -47,18 +50,53 @@ if ! git merge-base --is-ancestor HEAD origin/main; then
exit 1
fi
# Create a new branch for the release and make a commit with the new version.
# Determine version
if [ $# -ge 1 ]; then
VERSION="$1"
else
VERSION=$(printf '0.0.%d' "$(date +%y%m%d%H%M)")
fi
# Validate version format
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)(\.[0-9]+)?)?$ ]]; then
echo "ERROR: Invalid version format: $VERSION" >&2
echo " Expected format: X.Y.Z or X.Y.Z-alpha.N or X.Y.Z-beta.N" >&2
exit 1
fi
TAG="rust-v$VERSION"
git checkout -b "$TAG"
perl -i -pe "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
git add Cargo.toml
git commit -m "Release $VERSION"
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "ERROR: Tag $TAG already exists." >&2
echo " Please choose a different version." >&2
exit 1
fi
echo "Creating release for version: $VERSION"
echo "Tag: $TAG"
echo ""
echo "The GitHub Actions workflow will:"
echo " 1. Update version in Cargo.toml to $VERSION"
echo " 2. Build binaries with the correct version embedded"
echo " 3. Create a GitHub release with artifacts"
echo ""
read -p "Continue? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 1
fi
# Create and push the tag
git tag -a "$TAG" -m "Release $VERSION"
git push origin "refs/tags/$TAG"
git checkout "$CURRENT_BRANCH"
echo ""
echo "✅ Tag $TAG pushed successfully!"
echo ""
echo "📦 The release workflow has been triggered."
echo " View progress at: https://github.com/${GITHUB_REPOSITORY:-$(git remote get-url origin | sed 's/.*github.com[:/]\(.*\)\.git/\1/')}/actions"
echo ""
echo "Once the workflow completes, the release will be available at:"
echo " https://github.com/${GITHUB_REPOSITORY:-$(git remote get-url origin | sed 's/.*github.com[:/]\(.*\)\.git/\1/')}/releases/tag/$TAG"
+5 -7
View File
@@ -305,7 +305,7 @@ impl ChatWidget<'_> {
hud_height = hud_height.saturating_sub(1);
// keep within vertical budget (status+bottom+≥1 row history)
let available = area.height.saturating_sub(3 + bottom_height + 1) / 2;
let available = area.height.saturating_sub(5) / 3;
hud_height = hud_height.clamp(4, available);
return Layout::vertical([
@@ -1435,7 +1435,7 @@ impl ChatWidget<'_> {
});
format!(
"Browser mode enabled. Opening: {}\nScreenshots will be attached to model requests.",
"Browser mode enabled: {}\n",
full_url
)
} else {
@@ -1455,8 +1455,8 @@ impl ChatWidget<'_> {
// Update the config to use local Chrome connection
let browser_manager_local = browser_manager.clone();
let port_display =
port.map_or("auto-detected".to_string(), |p| p.to_string());
// Determine which port to use for launching
let launch_port = port.unwrap_or(9222);
tokio::spawn(async move {
// CRITICAL: Use the global browser manager for everything to avoid dual instances
@@ -1499,8 +1499,6 @@ impl ChatWidget<'_> {
e
);
// Determine which port to use for launching
let launch_port = port.unwrap_or(9222);
// Try launching Chrome with debug port
#[cfg(target_os = "macos")]
@@ -1536,7 +1534,7 @@ impl ChatWidget<'_> {
if port.is_some() {
format!(
"Connecting to local Chrome instance on port {}...\nIf Chrome is not running with debug port, it will be launched.",
port_display
launch_port
)
} else {
"Auto-scanning for local Chrome instance with debug port...\nIf no Chrome found, it will be launched on port 9222.".to_string()
+1 -1
View File
@@ -336,7 +336,7 @@ impl HistoryCell {
// Since we now have a status bar, just show helpful commands in history
let lines: Vec<Line<'static>> = vec![
Line::from("".dim()),
Line::from(" Popular commands:".dim()),
Line::from("Popular commands:".dim()),
Line::from(
format!(" /browser <url> - {}", SlashCommand::Browser.description()).dim(),
),
+3 -3
View File
@@ -227,17 +227,17 @@ pub async fn run_main(
);
if managed_by_npm {
let npm_cmd = "npm install -g @openai/codex@latest";
let npm_cmd = "npm install -g @just-every/coder@latest";
eprintln!("Run {} to update.", npm_cmd.cyan().on_black());
} else if cfg!(target_os = "macos")
&& (exe.starts_with("/opt/homebrew") || exe.starts_with("/usr/local"))
{
let brew_cmd = "brew upgrade codex";
let brew_cmd = "brew upgrade coder";
eprintln!("Run {} to update.", brew_cmd.cyan().on_black());
} else {
eprintln!(
"See {} for the latest releases and installation options.",
"https://github.com/openai/codex/releases/latest"
"https://github.com/just-every/coder/releases/latest"
.cyan()
.on_black()
);
+5 -5
View File
@@ -102,7 +102,7 @@ impl AuthModeWidget {
Line::from(vec![
Span::raw("> "),
Span::styled(
"Sign in with ChatGPT to use Codex as part of your paid plan",
"Sign in with ChatGPT to use your paid plan",
Style::default().add_modifier(Modifier::BOLD),
),
]),
@@ -223,17 +223,17 @@ impl AuthModeWidget {
Line::from(""),
Line::from("> Before you start:"),
Line::from(""),
Line::from(" Decide how much autonomy you want to grant Codex"),
Line::from(" Decide how much autonomy you want to grant Coder"),
Line::from(vec![
Span::raw(" For more details see the "),
Span::styled(
"\u{1b}]8;;https://github.com/openai/codex\u{7}Codex docs\u{1b}]8;;\u{7}",
"\u{1b}]8;;https://github.com/just-every/coder\u{7}Coder docs\u{1b}]8;;\u{7}",
Style::default().add_modifier(Modifier::UNDERLINED),
),
])
.style(Style::default().add_modifier(Modifier::DIM)),
Line::from(""),
Line::from(" Codex can make mistakes")
Line::from(" Coder can make mistakes")
.style(Style::default().fg(text_bright())),
Line::from(" Review the code it writes and commands it runs")
.style(Style::default().add_modifier(Modifier::DIM)),
@@ -279,7 +279,7 @@ impl AuthModeWidget {
fn render_env_var_missing(&self, area: Rect, buf: &mut Buffer) {
let lines = vec![
Line::from(
" To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment",
" To use Coder with the OpenAI API, set OPENAI_API_KEY in your environment",
)
.style(Style::default().fg(info())),
Line::from(""),
+2 -2
View File
@@ -51,7 +51,7 @@ struct ReleaseInfo {
}
const VERSION_FILENAME: &str = "version.json";
const LATEST_RELEASE_URL: &str = "https://api.github.com/repos/openai/codex/releases/latest";
const LATEST_RELEASE_URL: &str = "https://api.github.com/repos/just-every/coder/releases/latest";
fn version_filepath(config: &Config) -> PathBuf {
config.codex_home.join(VERSION_FILENAME)
@@ -70,7 +70,7 @@ async fn check_for_update(version_file: &Path) -> anyhow::Result<()> {
.header(
"User-Agent",
format!(
"codex/{} (+https://github.com/openai/codex)",
"codex/{} (+https://github.com/just-every/coder)",
env!("CARGO_PKG_VERSION")
),
)
+103
View File
@@ -0,0 +1,103 @@
# Fix for CARGO_PKG_VERSION Not Being Set During Releases
## Problem
The `CARGO_PKG_VERSION` environment variable was always showing "0.0.0" in release builds because:
1. The workspace `Cargo.toml` had `version = "0.0.0"` hardcoded
2. All packages inherited this version with `version = { workspace = true }`
3. The release process updated the version only in a tag/branch, not in the actual build environment
This caused issues with:
- Version checks in the application
- Update notifications showing incorrect versions
- MCP server version reporting
## Solution
The fix involves updating the GitHub Actions workflow to dynamically set the version from the release tag during the build process.
### Changes Made
#### 1. Updated GitHub Actions Workflow (`.github/workflows/rust-release.yml`)
The workflow now:
- Extracts the version from the tag name (e.g., `rust-v0.21.0` → `0.21.0`)
- Updates the `version` field in `codex-rs/Cargo.toml` before building
- Ensures all binaries are built with the correct version embedded
Key changes:
- Modified `tag-check` job to output the version
- Added "Update version in Cargo.toml" step in the `build` job
- Version is updated using `sed` before compilation
#### 2. Simplified Release Script (`codex-rs/scripts/create_github_release.sh`)
The script now:
- Only creates and pushes a tag (no branch or commit needed)
- Validates the version format
- Provides clear feedback about what will happen
- The actual version update happens in GitHub Actions
### How It Works
1. **Developer runs release script:**
```bash
./codex-rs/scripts/create_github_release.sh 0.21.0
```
2. **Script creates and pushes tag:**
- Validates version format
- Creates tag `rust-v0.21.0`
- Pushes to GitHub
3. **GitHub Actions workflow triggers:**
- Extracts version from tag (`0.21.0`)
- Updates `Cargo.toml`: `version = "0.21.0"`
- Builds all binaries with correct version
- Creates GitHub release with artifacts
4. **Binary contains correct version:**
- `env!("CARGO_PKG_VERSION")` returns `"0.21.0"`
- Version checks work correctly
- Update notifications show proper versions
### Testing
To test the version embedding locally:
```bash
# Run the test script
./test-version-embedding.sh
```
This script simulates what the GitHub Actions workflow does and verifies that `CARGO_PKG_VERSION` gets set correctly.
### Benefits
1. **No manual version updates needed** - Version is derived from the tag
2. **Single source of truth** - The tag name determines the version
3. **Consistent versioning** - All binaries in a release have the same version
4. **Simpler release process** - No need to commit version changes
### Important Notes
- The workspace `Cargo.toml` remains at `version = "0.0.0"` in the main branch
- The version is only updated during the release build process
- Local development builds will show "0.0.0" (this is expected)
- Release binaries will show the correct version from the tag
### Rollback
If you need to revert these changes:
1. Restore the original `create_github_release.sh` that updates and commits the version
2. Modify the workflow to expect the version to already be in `Cargo.toml`
3. Remove the "Update version in Cargo.toml" step from the workflow
### Future Improvements
Consider:
- Using a version management tool like `cargo-release`
- Implementing version bumping based on conventional commits
- Adding version validation to prevent accidental downgrades
+74
View File
@@ -0,0 +1,74 @@
#!/bin/bash
# Test script to verify that CARGO_PKG_VERSION gets set correctly
# This simulates what the GitHub Actions workflow does
set -euo pipefail
echo "🧪 Testing version embedding process..."
echo ""
# Save current state
ORIGINAL_VERSION=$(grep "^version = " codex-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "Current version in Cargo.toml: $ORIGINAL_VERSION"
# Test version
TEST_VERSION="9.9.9-test"
echo "Test version to embed: $TEST_VERSION"
echo ""
# Change to codex-rs directory
cd codex-rs
# Update version (like the workflow does)
echo "📝 Updating version in Cargo.toml..."
sed -i.bak "s/^version = \".*\"/version = \"$TEST_VERSION\"/" Cargo.toml
# Verify the update
echo "Updated Cargo.toml:"
grep "^version = " Cargo.toml
echo ""
# Update Cargo.lock
echo "🔄 Updating Cargo.lock..."
cargo update --workspace
# Build a small test binary to check version embedding
echo "🔨 Building test binary to verify version embedding..."
cat > test-version/src/main.rs << 'EOF'
fn main() {
println!("CARGO_PKG_VERSION: {}", env!("CARGO_PKG_VERSION"));
}
EOF
# Create a minimal test crate if it doesn't exist
if [ ! -f test-version/Cargo.toml ]; then
mkdir -p test-version/src
cat > test-version/Cargo.toml << EOF
[package]
name = "test-version"
version = { workspace = true }
edition = "2024"
EOF
fi
# Build the test binary
cargo build --manifest-path test-version/Cargo.toml
# Run it to see the embedded version
echo ""
echo "✅ Testing embedded version:"
./target/debug/test-version
# Clean up - restore original version
echo ""
echo "🧹 Restoring original version..."
sed -i.bak "s/^version = \".*\"/version = \"$ORIGINAL_VERSION\"/" Cargo.toml
cargo update --workspace
rm -rf test-version
echo ""
echo "✅ Test complete!"
echo ""
echo "If the test showed 'CARGO_PKG_VERSION: $TEST_VERSION', then the version"
echo "embedding process is working correctly and will work in GitHub Actions."