Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ on:
# main and preview MUST stay: release.yml requires a successful
# push-event Cross-platform CI run for the exact release SHA and states
# that a pull-request run does not qualify, so removing either branch
# breaks publication.
# breaks publication. release/** is the fork's release line: fork-release.yml
# demands the same push-event run for the tagged SHA on its release branch.
push:
branches: [main, preview]
branches: [main, preview, 'release/**']
paths:
- "Dockerfile"
- "compose.yaml"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/enforce-pr-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,8 @@ jobs:
let behindBase = 0;
let aheadMain = 0;
let ancestryLookupFailed = false;
const baseAllowed = ALLOWED_BASES.includes(pr.base.ref);
// Fork release lines (release/<version>) take PRs too; a tag is cut only from them.
const baseAllowed = ALLOWED_BASES.includes(pr.base.ref) || pr.base.ref.startsWith("release/");

// Stacked PR exception: base is another open PR's head branch (same
// head repo as this PR's base repo). Closed/missing parent stays wrong_base.
Expand Down Expand Up @@ -760,7 +761,8 @@ jobs:

let failures = collectPrQualityFailures({
baseRef: pr.base.ref,
allowedBases: ALLOWED_BASES,
// pr-quality.cjs is checked out from dev; widen its allow-list for this PR's own base here.
allowedBases: baseAllowed ? [pr.base.ref] : ALLOWED_BASES,
title: pr.title,
body: pr.body,
behindMain,
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/fork-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Fork release

# Fork-only (vadymhimself): a `v*-vadymhimself.*` tag publishes a GitHub Release carrying the
# npm tarball and its sha256. No npm publish. Upstream's release.yml is left untouched so syncs
# do not conflict. AgentRadar pulls only releases this workflow created.
on:
push:
tags: ['v*-vadymhimself.*']

permissions:
contents: write

concurrency:
group: fork-release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
persist-credentials: false

- name: Require a release branch, its green push CI, and a matching version
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
branches="$(git branch -r --contains "$GITHUB_SHA" --format='%(refname:short)' \
| sed -n -E 's#^origin/(main|release/.+)$#\1#p')"
if [ -z "$branches" ]; then
echo "::error::tag ${GITHUB_REF_NAME} (${GITHUB_SHA}) is on no release branch (main or release/*)"
exit 1
fi

# Same gate as release.yml: a push-event Cross-platform CI success for this exact SHA on
# the branch itself. A pull-request run does not qualify.
ci_url=""
for branch in $branches; do
ci_url="$(gh run list --workflow ci.yml --branch "$branch" --commit "$GITHUB_SHA" \
--event push --limit 10 --json conclusion,url \
--jq '[.[] | select(.conclusion == "success")][0].url // ""')"
[ -n "$ci_url" ] && break
done
if [ -z "$ci_url" ]; then
echo "::error::No successful push-event Cross-platform CI run for ${GITHUB_SHA} on: ${branches//$'\n'/ }"
exit 1
fi
echo "Cross-platform CI passed for ${GITHUB_SHA} on ${branch}: ${ci_url}"

version="$(node -p "require('./package.json').version")"
if [ "$version" != "${GITHUB_REF_NAME#v}" ]; then
echo "::error::package.json version ${version} does not match tag ${GITHUB_REF_NAME}"
exit 1
fi

- name: Setup project Bun
uses: ./.github/actions/setup-project-bun

- name: Build the package
run: |
set -euo pipefail
bun install --frozen-lockfile
bun run build:gui

- name: Pack and publish the GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
tgz="$(npm pack --silent | tail -n 1)"
sha256sum "$tgz" > "$tgz.sha256"
cat "$tgz.sha256"
gh release create "$GITHUB_REF_NAME" "$tgz" "$tgz.sha256" --verify-tag \
--title "gateway ${GITHUB_REF_NAME#v}" --notes-from-tag
2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opencodex-desktop"
version = "2.65.0-vadymhimself.15"
version = "2.65.0-vadymhimself.16"
description = "OpenCodex desktop shell"
authors = ["OpenCodex contributors"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "OpenCodex",
"version": "2.65.0-vadymhimself.15",
"version": "2.65.0-vadymhimself.16",
"identifier": "com.opencodex.desktop",
"build": {
"frontendDist": "../ui",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitkyc08/opencodex",
"version": "2.65.0-vadymhimself.15",
"version": "2.65.0-vadymhimself.16",
"description": "Universal provider proxy for OpenAI Codex & Claude Code — use any LLM with Codex CLI/App/SDK and Claude Code",
"type": "module",
"main": "./bin/package-main.mjs",
Expand Down
7 changes: 5 additions & 2 deletions src/codex/auth-api/main-account-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ export async function fetchMainAccountInfoWhileOwned(
markAccountNeedsReauth(MAIN_CODEX_ACCOUNT_ID, writerGeneration);
}
// Keep the last-known plan visible: after a plan change revokes the session, the plan the
// account HAD is what tells the operator why it stopped working.
// account HAD is what tells the operator why it stopped working. A transient failure proves
// nothing about the plan, so it stays unknown and stale quota is reported as coverage-only.
return {
info: { ...EMPTY_MAIN_ACCOUNT_INFO, plan: nonEmptyPlan(cached?.plan) ?? nonEmptyPlan(getMainAccountPlan()) },
info: terminalAuthFailure
? { ...EMPTY_MAIN_ACCOUNT_INFO, plan: nonEmptyPlan(cached?.plan) ?? nonEmptyPlan(getMainAccountPlan()) }
: EMPTY_MAIN_ACCOUNT_INFO,
credentialChecked: true, hasCredential: true,
quotaRefresh: { status: "http_error", httpStatus: resp.status,
...(authFailure.code ? { code: authFailure.code } : {}) },
Expand Down
2 changes: 1 addition & 1 deletion tests/ci-workflows/ci-review-lanes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("CI review lanes", () => {
jobs?: Record<string, Record<string, unknown> | undefined>;
};
expect([...(ci.on?.push?.branches ?? [])].sort())
.toEqual(["main", "preview"]);
.toEqual(["main", "preview", "release/**"]);

// The PR trigger must carry NO base-branch filter, and the two triggers
// differ on purpose. GitHub matches `branches:` against the BASE ref, so
Expand Down
4 changes: 2 additions & 2 deletions tests/ci-workflows/ci-scope-reduction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ function runGate(inputs: GateInputs, results: Record<string, string>): { gatedJo
}

describe("the push trigger", () => {
test("carries main and preview, and no longer dev", () => {
test("carries main, preview and the fork release lines, and no longer dev", () => {
// main and preview must stay: release.yml requires a successful push-event
// run for the exact release SHA and states that a pull_request run does not
// qualify, so removing either breaks publication. dev is the deliberate
// removal — its integration evidence is the pull_request run, and
// workflow_dispatch covers anything else — so the push run stopped doubling
// the full matrix behind a merge that was just verified as a PR.
expect([...(workflow.on?.push?.branches ?? [])].sort()).toEqual(["main", "preview"]);
expect([...(workflow.on?.push?.branches ?? [])].sort()).toEqual(["main", "preview", "release/**"]);
});
});

Expand Down
28 changes: 28 additions & 0 deletions tests/ci-workflows/ci-workflows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3875,6 +3875,34 @@ describe("GitHub Actions hardening", () => {
expect(result.warnings.some((w) => w.startsWith("setFailed:"))).toBe(true);
});

test("a fork release-line base is allowed", async () => {
const result = await run({
pr: { base: { ref: "release/2.65.0-vadymhimself.16" }, title: "Release fix", draft: false },
authorPermission: "write",
});

expect(methodsOf(result)).toEqual(readsAllowedBase());
expect(callsTo(result, "pulls.update")).toEqual([]);
expect(result.warnings.some((w) => w.startsWith("setFailed:"))).toBe(false);
});

test("a base that only starts with the word release is still wrong-base", async () => {
const result = await run({
pr: { base: { ref: "releasefoo" }, title: "Not a release", draft: false },
authorPermission: "write",
});

expect(methodsOf(result)).toEqual(readsWrongBase([
"pulls.update",
"issues.createComment",
"graphql",
]));
expect(callsTo(result, "pulls.update")).toEqual([
{ owner: "lidge-jun", repo: "opencodex", pull_number: 42, title: "[WRONG BRANCH] Not a release" },
]);
expect(result.warnings.some((w) => w.startsWith("setFailed:"))).toBe(true);
});

test("a non-dev base with no open parent PR is still wrong-base", async () => {
const result = await run({
pr: { base: { ref: "feature/orphan" }, title: "Orphan stack", draft: false },
Expand Down
14 changes: 9 additions & 5 deletions tests/ci-workflows/release-preflight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ const OWN_IS_PREVIEW = OWN_VERSION.includes("-preview.");
const OWN_REF = OWN_IS_PREVIEW ? "refs/heads/preview" : "refs/heads/main";
const OWN_TAG = OWN_IS_PREVIEW ? "preview" : "latest";
const NEXT_CORE = `${MAJOR}.${MINOR + 1}.0`;
// Fork quarantine (GW-CD-19243; the fork has issues disabled): these scenarios release the checkout's
// own version through upstream's npm policy (stable semver on main, no version npm already has). A
// `-vadymhimself.N` tree can never satisfy that and the fork never publishes to npm, so they skip there.
const FORK = /-vadymhimself\./.test(OWN_VERSION);

const FAKE_GH = [
"#!/bin/sh",
Expand Down Expand Up @@ -180,7 +184,7 @@ function preflight(scenario: Scenario): { status: number | null; output: string;
}

describe.skipIf(process.platform === "win32")("scripts/ci/release-preflight.sh, executed", () => {
test("replays run 35783865160: a higher-core tag refuses the release before packaging", () => {
test.skipIf(FORK)("replays run 35783865160: a higher-core tag refuses the release before packaging", () => {
const blocker = OWN_IS_PREVIEW ? `v${NEXT_CORE}` : `v${NEXT_CORE}-preview.20260923`;
const result = preflight({ tags: ["v0.0.1", blocker] });
expect(result.status, result.output).toBe(1);
Expand All @@ -189,14 +193,14 @@ describe.skipIf(process.platform === "win32")("scripts/ci/release-preflight.sh,
expect(result.summary).toContain(`Release preflight refused ${OWN_VERSION}`);
}, SPAWN_BUDGET_MS);

test("passes a release every check can already approve", () => {
test.skipIf(FORK)("passes a release every check can already approve", () => {
const result = preflight({ tags: ["v0.0.1"] });
expect(result.status, result.output).toBe(0);
expect(result.output).toContain("Release preflight passed");
expect(result.summary).toBe("");
}, SPAWN_BUDGET_MS);

test("refuses a version npm already has unless the run is a dry run", () => {
test.skipIf(FORK)("refuses a version npm already has unless the run is a dry run", () => {
const real = preflight({ tags: ["v0.0.1"], npm: "present" });
expect(real.status, real.output).toBe(1);
expect(real.output).toContain("already exists on npm");
Expand All @@ -217,7 +221,7 @@ describe.skipIf(process.platform === "win32")("scripts/ci/release-preflight.sh,
expect(result.output).toContain("is not on npm");
}, SPAWN_BUDGET_MS);

test("warns rather than blocks when npm cannot be read", () => {
test.skipIf(FORK)("warns rather than blocks when npm cannot be read", () => {
const result = preflight({ tags: ["v0.0.1"], npm: "unreadable" });
expect(result.status, result.output).toBe(0);
expect(result.output).toContain("::warning::Could not read npm");
Expand All @@ -232,7 +236,7 @@ describe.skipIf(process.platform === "win32")("scripts/ci/release-preflight.sh,
expect(missing.output).toContain("refs/remotes/origin/dev");
}, SPAWN_BUDGET_MS);

test("reports every problem in one run", () => {
test.skipIf(FORK)("reports every problem in one run", () => {
const wrongTag = OWN_TAG === "latest" ? "preview" : "latest";
const result = preflight({ tags: ["v0.0.1"], distTag: wrongTag, npm: "present" });
expect(result.status, result.output).toBe(1);
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/file-size-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
".github/scripts/issue-quality.test.cjs": 2143,
"gui/src/pages/Models.tsx": 2787,
"gui/src/styles.css": 2958,
"src/adapters/anthropic.ts": 2031,
"src/adapters/anthropic.ts": 2035,
"src/adapters/openai-chat.ts": 820,
"src/adapters/openai-responses.ts": 6,
"src/bridge.ts": 7,
Expand All @@ -35,11 +35,11 @@
"src/server/index.ts": 890,
"src/server/request-log.ts": 2152,
"src/server/responses/core.ts": 210,
"tests/ci-workflows/ci-workflows.test.ts": 5449,
"tests/ci-workflows/ci-workflows.test.ts": 5477,
"tests/claude-integration/claude-messages-endpoint.test.ts": 6026,
"tests/claude-integration/claude-outbound.test.ts": 2035,
"tests/cli/cli-account.test.ts": 2313,
"tests/codex-integration/codex-auth-api.test.ts": 6514,
"tests/codex-integration/codex-auth-api.test.ts": 6544,
"tests/codex-integration/codex-auth-context.test.ts": 2433,
"tests/codex-integration/codex-catalog.test.ts": 7974,
"tests/codex-integration/codex-reset-credit-recovery.test.ts": 2135,
Expand Down
Loading