@sabaiway/agent-workflow-kit 22.2.0 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -1
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +11 -10
- package/bridges/antigravity-cli-bridge/bin/agy-jev.test.mjs +56 -7
- package/bridges/antigravity-cli-bridge/bin/agy-review.sh +81 -63
- package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +0 -21
- package/bridges/antigravity-cli-bridge/bin/agy.sh +86 -12
- package/bridges/antigravity-cli-bridge/capability.json +4 -5
- package/bridges/antigravity-cli-bridge/references/models-and-flags.md +3 -3
- package/bridges/antigravity-cli-bridge/service-facts.txt +11 -0
- package/bridges/antigravity-cli-bridge/setup/README.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +23 -24
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +82 -47
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +133 -52
- package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +44 -14
- package/bridges/codex-cli-bridge/bin/codex-review.sh +103 -30
- package/bridges/codex-cli-bridge/capability.json +7 -8
- package/bridges/codex-cli-bridge/references/driving-codex.md +6 -7
- package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +8 -11
- package/bridges/codex-cli-bridge/service-facts.txt +9 -0
- package/bridges/codex-cli-bridge/setup/README.md +3 -3
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/recommendations.md +3 -3
- package/references/modes/velocity.md +1 -1
- package/tools/bridge-sandbox-recipe.mjs +9 -6
- package/tools/bridge-state-dirs.mjs +2 -2
- package/tools/detect-backends.mjs +23 -15
- package/tools/manifest/schema.md +28 -47
- package/tools/manifest/validate.mjs +22 -60
- package/tools/procedures.mjs +1 -1
- package/tools/services/antigravity.json +17 -0
- package/tools/services/codex.json +15 -0
- package/tools/services/index.mjs +127 -0
- package/tools/services/jev.json +12 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# Auth: SUBSCRIPTION ONLY. We use the cached OAuth token at
|
|
10
10
|
# ~/.gemini/antigravity-cli/antigravity-oauth-token (Google AI Pro) and the
|
|
11
11
|
# quota that comes with it. To make that guarantee hard, the wrapper unsets
|
|
12
|
-
# every *_API_KEY except
|
|
12
|
+
# every *_API_KEY except the passed variables its service-facts.txt lists, so a stray
|
|
13
13
|
# key can never silently switch us to paid pay-as-you-go billing.
|
|
14
14
|
#
|
|
15
15
|
# This is a THIN, FLOW-AGNOSTIC wrapper on purpose: it just runs one headless
|
|
@@ -35,6 +35,76 @@
|
|
|
35
35
|
# # --model* and --effort* refuse — the model is AGY_MODEL)
|
|
36
36
|
set -euo pipefail
|
|
37
37
|
|
|
38
|
+
aw_script_dir() {
|
|
39
|
+
local src="${BASH_SOURCE[0]}" dir hops=0 max_hops=16
|
|
40
|
+
while :; do
|
|
41
|
+
case "$src" in */*) dir="${src%/*}"; dir="${dir:-/}" ;; *) dir=. ;; esac
|
|
42
|
+
dir="$(CDPATH= builtin cd -P -- "$dir" 2>/dev/null && builtin pwd -P)" || break
|
|
43
|
+
[[ -L "$src" ]] || { printf '%s\n' "$dir"; return 0; }
|
|
44
|
+
if (( hops >= max_hops )); then
|
|
45
|
+
printf 'error: exceeded %s symlink hops; could not resolve its OWN directory\n' "$max_hops" >&2
|
|
46
|
+
return 127
|
|
47
|
+
fi
|
|
48
|
+
hops=$((hops + 1))
|
|
49
|
+
src="$(command readlink -- "$src" 2>/dev/null)" || break
|
|
50
|
+
case "$src" in /*) ;; *) src="$dir/$src" ;; esac
|
|
51
|
+
done
|
|
52
|
+
printf 'error: could not resolve its OWN directory\n' >&2
|
|
53
|
+
return 127
|
|
54
|
+
}
|
|
55
|
+
aw_read_service_facts() {
|
|
56
|
+
local path="${1%/*}/service-facts.txt" line key value entry number=0 bad=0 valid seen=() run_lines=()
|
|
57
|
+
local host_re='^(\*\.)?[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-]*[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])?(\.[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-]*[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])?)+$'
|
|
58
|
+
local variable_re='^[ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*$'
|
|
59
|
+
local command_re='^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-]* \*$'
|
|
60
|
+
local env directory segments LC_ALL=C
|
|
61
|
+
AW_FACT_HOST=() AW_FACT_RUN_HOST=() AW_FACT_PASSED_VARIABLE=()
|
|
62
|
+
if [[ -f "$path" && -r "$path" ]]; then
|
|
63
|
+
while IFS= read -r line; do
|
|
64
|
+
number=$((number + 1)); valid=1
|
|
65
|
+
if (( number == 1 )); then
|
|
66
|
+
[[ "$line" == "# generated from the kit's service fragments (agent-workflow-kit/tools/services/); do not edit" ]] || bad=1
|
|
67
|
+
continue
|
|
68
|
+
fi
|
|
69
|
+
key="${line%%=*}"; value="${line#*=}"
|
|
70
|
+
[[ "$line" == *=* ]] || valid=0
|
|
71
|
+
case "$key" in
|
|
72
|
+
HOST|RUN_HOST) [[ "$value" =~ $host_re ]] || valid=0
|
|
73
|
+
if [[ "$key" == RUN_HOST && "$value" == '*.'* ]]; then valid=0; fi ;;
|
|
74
|
+
PASSED_VARIABLE) [[ "$value" =~ $variable_re && "$value" != OPENAI_BASE_URL ]] || valid=0 ;;
|
|
75
|
+
EXCLUDED_COMMAND) [[ "$value" =~ $command_re ]] || valid=0 ;;
|
|
76
|
+
WRITABLE_DIR)
|
|
77
|
+
env="${value%%:*}"; directory="${value#*:}"; segments="/${directory//\\//}/"
|
|
78
|
+
[[ "$value" == *:* && ( -z "$env" || "$env" =~ $variable_re ) &&
|
|
79
|
+
( "$directory" == '~/'* || "$directory" == /* ) && "$directory" != */ &&
|
|
80
|
+
"$directory" != *[\*\?\[\]]* && ! "$directory" =~ [[:cntrl:]] && "$segments" != */../* ]] || valid=0 ;;
|
|
81
|
+
*) valid=0 ;;
|
|
82
|
+
esac
|
|
83
|
+
for entry in ${seen[@]+"${seen[@]}"}; do [[ "$entry" != "$line" ]] || valid=0; done
|
|
84
|
+
if (( ! valid )); then (( bad )) || bad=$number; continue; fi
|
|
85
|
+
seen+=("$line")
|
|
86
|
+
case "$key" in
|
|
87
|
+
HOST) AW_FACT_HOST+=("$value") ;; RUN_HOST) AW_FACT_RUN_HOST+=("$value"); run_lines+=("$number") ;;
|
|
88
|
+
PASSED_VARIABLE) AW_FACT_PASSED_VARIABLE+=("$value") ;;
|
|
89
|
+
esac
|
|
90
|
+
done <"$path"
|
|
91
|
+
if (( ! number )); then bad=1; fi
|
|
92
|
+
if [[ -n "$line" ]] && (( ! bad )); then bad=$((number + 1)); fi
|
|
93
|
+
for ((number=0; number<${#AW_FACT_RUN_HOST[@]}; number++)); do
|
|
94
|
+
valid=0
|
|
95
|
+
for entry in ${AW_FACT_HOST[@]+"${AW_FACT_HOST[@]}"}; do [[ "$entry" != "${AW_FACT_RUN_HOST[number]}" ]] || valid=1; done
|
|
96
|
+
if (( ! valid && (! bad || run_lines[number] < bad) )); then bad=${run_lines[number]}; fi
|
|
97
|
+
done
|
|
98
|
+
(( bad )) || return 0
|
|
99
|
+
printf 'error: %s: invalid facts at line %s; remove whatever is at that path and run /agent-workflow-kit upgrade to write it again\n' "$path" "$bad" >&2
|
|
100
|
+
else
|
|
101
|
+
printf 'error: %s: not a readable regular file; remove whatever is at that path and run /agent-workflow-kit upgrade to write it again\n' "$path" >&2
|
|
102
|
+
fi
|
|
103
|
+
exit 127
|
|
104
|
+
}
|
|
105
|
+
HERE="$(aw_script_dir)" || exit 127
|
|
106
|
+
aw_read_service_facts "$HERE"
|
|
107
|
+
|
|
38
108
|
# --- --help / -h (pre-preflight: no agy, no login needed) ----------------------
|
|
39
109
|
# Keyed ONLY on the FIRST argument — never a scan of all args, else a passthrough
|
|
40
110
|
# payload like `agy-run "prompt" -- --help` would be intercepted. agy-run is the
|
|
@@ -255,15 +325,15 @@ aw_resolve_timeout_bin() {
|
|
|
255
325
|
printf '%s' "$bin"
|
|
256
326
|
}
|
|
257
327
|
aw_scrub_billing_keys() {
|
|
258
|
-
|
|
259
|
-
# switch a run to paid billing; TYPESAFE_API_KEY is neither read nor set, so it reaches the CLI exactly as given.
|
|
260
|
-
local name
|
|
328
|
+
local name passed keep
|
|
261
329
|
unset OPENAI_BASE_URL 2>/dev/null || true
|
|
262
330
|
for name in $(compgen -v); do
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
331
|
+
[[ "$name" == *_API_KEY ]] || continue
|
|
332
|
+
keep=0
|
|
333
|
+
for passed in ${AW_FACT_PASSED_VARIABLE[@]+"${AW_FACT_PASSED_VARIABLE[@]}"}; do
|
|
334
|
+
[[ "$name" != "$passed" ]] || keep=1
|
|
335
|
+
done
|
|
336
|
+
if (( ! keep )); then unset "$name" 2>/dev/null || true; fi
|
|
267
337
|
done
|
|
268
338
|
return 0
|
|
269
339
|
}
|
|
@@ -431,10 +501,14 @@ fi
|
|
|
431
501
|
|
|
432
502
|
agy_cmd=(agy "${model_flag[@]}" --print-timeout "$AGY_TIMEOUT" "${passthrough[@]}" -p "$prompt")
|
|
433
503
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
504
|
+
aw_passed_names=""
|
|
505
|
+
if [[ "${AW_AGY_REVIEW_CHILD:-}" != "1" ]]; then
|
|
506
|
+
for aw_name in ${AW_FACT_PASSED_VARIABLE[@]+"${AW_FACT_PASSED_VARIABLE[@]}"}; do
|
|
507
|
+
if [[ -n "${!aw_name:-}" ]]; then aw_passed_names+="${aw_passed_names:+, }$aw_name"; fi
|
|
508
|
+
done
|
|
509
|
+
if [[ -n "$aw_passed_names" ]]; then
|
|
510
|
+
echo "passed variables: $aw_passed_names; a headless agy runs a request that uses them only where your agy permissions allow commands — the first denied command ends the run" >&2
|
|
511
|
+
fi
|
|
438
512
|
fi
|
|
439
513
|
|
|
440
514
|
# Hard wall-clock cap via timeout(1) (GNU `timeout` on Linux, `gtimeout` from coreutils on macOS).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"name": "antigravity-cli-bridge",
|
|
5
5
|
"kind": "execution-backend",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "8.0.0",
|
|
7
7
|
"provides": ["review", "probe"],
|
|
8
8
|
"posture": { "model": "Gemini 3.8 Flash (High)" },
|
|
9
9
|
"roles": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides; plan/diff outside a git tree: warn + skip unless overridden): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan/diff mode; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of numbered items in the first ### Blocking section; artifactPath = the normalized realpath on plan/diff receipts only (repo-relative inside the work tree, absolute otherwise), while a double quote, backslash or control byte refuses pre-spend because the receipt encoder cannot carry it; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (code mode refuses pre-spend without one — no run, no receipt — unless --ungrounded/AGY_PROBE=1; in plan/diff an empty payload records grounded:false — fail-closed, the state gate rejects it), factsHash = sha256 of the facts payload; a continuation receipt is fresh:false (informational-only — it cannot attest the folded tree); probe = whether the run relaxed the quality guards (AGY_PROBE=1), written on EVERY receipt so it self-declares — the kit's review-state gate rejects a probe-marked receipt (a probe review never attests) and equally rejects an unmarked one (silence is not a declaration); posture = the ACTUAL run posture {model} (agy has no tier), written on EVERY receipt (D5) — the gate rejects a receipt with an absent/invalid posture (a pre-D5 wrapper minted it; re-run the review), one stderr banner line states the same posture, a one-off model (an explicitly empty AGY_MODEL included) refuses pre-spend unless AGY_PROBE=1, and a model string carrying control bytes refuses pre-spend in every mode; delivery = how the change set REACHED the model, currently emitted as 'inline' (the whole set rode one prompt — proven by construction) or 'fed' (a chunked feed whose per-part echo proof verified); REQUIRED on every agy code receipt and its ABSENCE is what stops a pre-fed-lane receipt attesting, while the gate accepts any well-formed declaration rather than a particular value; absent by construction on plan/diff/continuation receipts, which carry no change set; a run whose output carries NO recognized '### Verdict' section — empty output included — exits 4 with NO receipt (D4: a FAILED review to RE-RUN, never a fatal session error); when the dispatch nonce seam is supplied — the AW_REVIEW_NONCE environment value or its plain-argument equivalent --nonce <n> (one seam: the flag assigns the same value; supplying both with different values refuses pre-spend) — under the safe grammar [A-Za-z0-9._-]{1,64} (anything else refuses pre-spend), the wrapper first mints the finding MANIFEST {schema, backend, nonce, fingerprint, findings} beside the receipts file (agent-workflow-finding-manifest-<backend>-<nonce>.json; atomic, no-clobber — a byte-identical rewrite is an idempotent no-op, different bytes refuse loudly) ORDERED before the receipt append — a failed manifest write EXCLUDES the receipt append, so a nonce-supplied dispatch can never land a receipt without its readable manifest; a nonce-less invocation adds NO nonce field and mints NO finding manifest (the existing wrapperVersion field still changes with each bridge release); a write failure warns, never fails the review",
|
|
35
35
|
"notes": [
|
|
36
36
|
"transport: every review dispatch drives the CLI in --output-format json (plus --disable-slash-commands) and the returned envelope is parsed in node (bin/agy-envelope.mjs) — the operator-facing invocations and flags above do NOT change, and on a ZERO exit the wrapper still PRINTS the review text, never JSON. A missing or unreadable envelope on a zero exit is a loud failure with NO receipt, never a downgraded verdict and never a fallback to raw-stdout parsing; a non-zero CLI exit keeps its own code and message, and publishes the captured stdout unchanged from the SINGLE dispatch or the FINAL fed turn (which may therefore be a JSON or partial payload — the envelope is parsed only on a zero exit); an INTERMEDIATE feed turn is the exception, its output stays private (Invariant E) and its failure prints only a named error. Enforced by a PRE-SPEND capability probe, not a version floor: agy --help must advertise --output-format and --disable-slash-commands, node must be >= 22, and bin/agy-envelope.mjs must be present — otherwise the review refuses before any run is spent and names the missing capability",
|
|
37
|
-
"pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff its
|
|
37
|
+
"pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff the hosts of the services its manifest names against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE dispatching, never fired into a known prompt",
|
|
38
38
|
"the review posture banner appends a banner-only source=model:<s> field — where the model came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration agy-run hands to timeout(1); the hard-timeout preflight fails CLOSED when no timeout/gtimeout binary exists (the wrapper refuses by name before any CLI run, so an uncapped review run can no longer happen), and neither field enters the receipt posture or the D5 banner↔receipt parity",
|
|
39
39
|
"quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts"
|
|
40
40
|
]
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
{ "slot": "<extra agy flags...>", "required": false, "description": "raw agy flags after -- (a --model* or --effort* flag refuses pre-spend: the model is the host posture or the AGY_MODEL environment value)" }
|
|
181
181
|
],
|
|
182
182
|
"guardrails": [
|
|
183
|
-
{ "value": "subscription-only — every *_API_KEY
|
|
183
|
+
{ "value": "subscription-only — every *_API_KEY except the passed variables its service-facts.txt lists is unset before the run; those variables pass as given and nothing in agy's permissions is widened", "enforcement": "enforced", "source": "bin/agy.sh" },
|
|
184
184
|
{ "value": "the model is the host posture (AGY_MODEL in the bridge settings file, else Gemini 3.8 Flash (High)); AGY_MODEL in the environment sets it for one run", "enforcement": "enforced", "source": "bin/agy.sh" },
|
|
185
185
|
{ "value": "hard wall-clock cap AGY_HARD_TIMEOUT (built-in default 5m)", "enforcement": "enforced", "condition": "only while timeout(1)/gtimeout is on PATH — otherwise the wrapper warns and runs uncapped", "source": "capability.json settings.AGY_HARD_TIMEOUT" },
|
|
186
186
|
{ "value": "the prompt rides a single argv — over AGY_MAX_PROMPT_BYTES (120000) the run refuses", "enforcement": "enforced", "source": "bin/agy.sh" },
|
|
@@ -240,8 +240,7 @@
|
|
|
240
240
|
"effect": "agy-review code: the ceiling on the SUM of all outgoing prompt bytes the chunked feed may send (every feed-turn framing block, every body, the final turn). Checked BEFORE the first turn is spent; past it the fed review refuses. An economy guard, not the correctness guard — correctness is the per-part delivery echo."
|
|
241
241
|
}
|
|
242
242
|
],
|
|
243
|
-
"
|
|
244
|
-
"writableDirs": [{ "env": null, "default": "~/.gemini/antigravity-cli" }],
|
|
243
|
+
"services": ["antigravity", "jev"],
|
|
245
244
|
"detect": {
|
|
246
245
|
"installed": {
|
|
247
246
|
"env": "ANTIGRAVITY_CLI_BRIDGE_DIR",
|
|
@@ -52,9 +52,9 @@ Environment:
|
|
|
52
52
|
| `AGY_MAX_PROMPT_BYTES` | `120000` | single-argv byte ceiling. `agy` takes the prompt as ONE `-p` argv; past `MAX_ARG_STRLEN` (~131072) `execve` fails with a cryptic `Argument list too long`. The wrapper measures the resolved `-`/`@file` prompt and fails loud over the ceiling. A huge **literal** `agy-run "<huge>"` fails at the wrapper's own `exec`, so route large prompts via `-`/`@file`. |
|
|
53
53
|
|
|
54
54
|
Subscription invariant: the wrapper prepends `$HOME/.local/bin` to `PATH` and clears `OPENAI_BASE_URL`
|
|
55
|
-
and every `*_API_KEY` except
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
and every `*_API_KEY` except the passed variables its service-facts.txt lists before execution; those
|
|
56
|
+
variables pass as given, with no permissions widened. Auth comes from the user's cached OAuth token,
|
|
57
|
+
never from bundled credentials.
|
|
58
58
|
|
|
59
59
|
## `agy-review` contract (review role)
|
|
60
60
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# generated from the kit's service fragments (agent-workflow-kit/tools/services/); do not edit
|
|
2
|
+
HOST=*.googleapis.com
|
|
3
|
+
HOST=accounts.google.com
|
|
4
|
+
HOST=antigravity-unleash.goog
|
|
5
|
+
HOST=lh3.googleusercontent.com
|
|
6
|
+
HOST=api.typesafe.ai
|
|
7
|
+
HOST=docs.typesafe.ai
|
|
8
|
+
RUN_HOST=api.typesafe.ai
|
|
9
|
+
RUN_HOST=docs.typesafe.ai
|
|
10
|
+
WRITABLE_DIR=:~/.gemini/antigravity-cli
|
|
11
|
+
PASSED_VARIABLE=TYPESAFE_API_KEY
|
|
@@ -34,7 +34,7 @@ agy
|
|
|
34
34
|
This caches an OAuth token under `~/.gemini/antigravity-cli/` (`antigravity-oauth-token`). That token
|
|
35
35
|
is **personal** — never copy, commit, package, print, or share that directory or token. This skill
|
|
36
36
|
needs no API keys and must not be configured with API-key billing; the wrapper unsets every
|
|
37
|
-
`*_API_KEY` except
|
|
37
|
+
`*_API_KEY` except the passed variables its service-facts.txt lists (which pass as given) so billing can never
|
|
38
38
|
silently fall back to pay-as-you-go.
|
|
39
39
|
|
|
40
40
|
## 3. Put the wrappers on `PATH` (`agy-run` + `agy-review`)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: codex-cli-bridge
|
|
3
3
|
description: Delegate work to the OpenAI Codex CLI (`codex`) under a ChatGPT subscription — run plan/instruction EXECUTION in a sandboxed workspace, or get a read-only ADVISORY review of a plan or working-tree diff — as a second delegated-execution backend beside Antigravity. Use when the user wants to hand a bounded coding task or plan to `codex exec`, get a second-opinion review from codex, install or authenticate Codex CLI, understand its sandbox/network/approval policy, drive codex efficiently from the main agent (exec vs review, resume, the commit boundary), bridge project context (`AGENTS.md`) into codex, or troubleshoot codex flags, models, auth, or its no-TTY headless behaviour.
|
|
4
4
|
metadata:
|
|
5
|
-
version: '
|
|
5
|
+
version: '6.0.0'
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# codex-cli-bridge
|
|
@@ -19,7 +19,7 @@ or a working-tree diff and only emits findings (`codex-review`).
|
|
|
19
19
|
Use this skill when the user wants to:
|
|
20
20
|
|
|
21
21
|
- Delegate plan or instruction EXECUTION to `codex` in a workspace-write sandbox (network to
|
|
22
|
-
|
|
22
|
+
the run hosts its service-facts.txt lists where the permissions profile `jev` runs, off elsewhere).
|
|
23
23
|
- Get a second-opinion ADVISORY review of an implementation plan or the current diff.
|
|
24
24
|
- Install, authenticate, smoke-test, or troubleshoot `codex`, or understand its sandbox/flags/models.
|
|
25
25
|
- Drive codex efficiently from the main agent (exec vs review, `resume`, the commit boundary).
|
|
@@ -40,9 +40,8 @@ binary, run `codex login` once under a ChatGPT subscription, then expose this sk
|
|
|
40
40
|
print, copy, commit, or package `~/.codex/auth.json` — it is personal and is **never bundled** with
|
|
41
41
|
this skill. Both wrappers enforce the subscription path before invoking codex:
|
|
42
42
|
|
|
43
|
-
- they **unset `OPENAI_BASE_URL` and every `*_API_KEY` except
|
|
44
|
-
|
|
45
|
-
switch you to paid api-key billing;
|
|
43
|
+
- they **unset `OPENAI_BASE_URL` and every `*_API_KEY` except the passed variables its service-facts.txt lists**
|
|
44
|
+
(those variables pass as given) so a stray key can never silently switch you to paid api-key billing;
|
|
46
45
|
- they pass **`--ignore-user-config`** so a personal `~/.codex/config.toml` cannot change model,
|
|
47
46
|
sandbox, or approval behaviour (auth still works — codex reads the login from `CODEX_HOME`
|
|
48
47
|
regardless of that flag);
|
|
@@ -99,7 +98,7 @@ waste, never lowering quality. Full knob list: [§ Environment knobs](#environme
|
|
|
99
98
|
Drive codex only through the two wrappers (installed on `PATH`), run from the target project root:
|
|
100
99
|
|
|
101
100
|
```bash
|
|
102
|
-
# EXECUTION (workspace writes; network to
|
|
101
|
+
# EXECUTION (workspace writes; network to the run hosts its service-facts.txt lists under the profile `jev`, else off; never prompts):
|
|
103
102
|
codex-exec docs/plans/<slug>.md # drive a plan file
|
|
104
103
|
echo "apply review fix: ..." | codex-exec - # ad-hoc instruction from stdin
|
|
105
104
|
codex-exec <file|-> -- <extra codex flags...> # GUARDED passthrough after `--` (policy/model/capture flags rejected; some relaxed only under CODEX_PROBE=1)
|
|
@@ -125,7 +124,7 @@ receipt records the same `posture {model, effort, tier}` (tier `null` on the sta
|
|
|
125
124
|
bytes in a posture value refuse pre-spend in every mode. `codex-exec` states its posture the same way —
|
|
126
125
|
ONE `exec posture: model=… effort=… tier=… sandbox=jev-profile|workspace-write session=fresh|resume:<id>
|
|
127
126
|
jev=… source=… timeout=…` stderr line before dispatch (the resume id validated pre-spend). The `jev=`
|
|
128
|
-
field says what the run reaches:
|
|
127
|
+
field says what the run reaches: the run hosts its service-facts.txt lists under the permissions profile `jev`
|
|
129
128
|
(Linux, codex-cli 0.160.0 or newer, for `codex-exec` a repository outside every temp root, a codex
|
|
130
129
|
version and profile digest not recorded as refused), else `jev=unreachable (<reason>)` on today's flags.
|
|
131
130
|
A run whose codex refuses the profile (a profile error before the turn starts, or `bwrap: execvp` in a
|
|
@@ -182,9 +181,9 @@ anything that would defeat a policy is guarded — see [§ Models](#models-the-h
|
|
|
182
181
|
| `CODEX_REVIEW_SCHEMA` | unset | `codex-review`: `=1` returns findings as a validated JSON object (`--output-schema`), with a raw-text fallback. Default off. |
|
|
183
182
|
| `CODEX_PROBE` | unset | `=1` ⇒ throwaway-probe mode: the one route to a one-off model or effort, and it relaxes the tier-2 passthrough guard (echoed loudly); a probe review's receipt never attests. Never for real work. |
|
|
184
183
|
|
|
185
|
-
The git-write shim, `--ignore-user-config`, the key rule (`OPENAI_BASE_URL` and every `*_API_KEY`
|
|
186
|
-
|
|
187
|
-
they are fixed invariants.
|
|
184
|
+
The git-write shim, `--ignore-user-config`, the key rule (unset `OPENAI_BASE_URL` and every `*_API_KEY`
|
|
185
|
+
except the passed variables its service-facts.txt lists) and the choice between the profile and today's
|
|
186
|
+
flags are NOT env-tunable — they are fixed invariants.
|
|
188
187
|
|
|
189
188
|
### Dispatch identity — the accounted exec lane
|
|
190
189
|
|
|
@@ -251,14 +250,14 @@ you truly mean it.
|
|
|
251
250
|
|
|
252
251
|
**The Jev skill in a delegated run.** A `codex-exec` or `codex-review` run loads the vendor's Jev skill from the
|
|
253
252
|
user root the kit's `jev-skill` command fills, `~/.agents/skills` (a run under `--ignore-user-config` listed its
|
|
254
|
-
skills, measured 2026-10-02; `codex-review` links that root into its fence home), and `TYPESAFE_API_KEY` passes
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
writes nothing, and the banner
|
|
259
|
-
flags with network off and
|
|
260
|
-
`web_search` reaches pages outside the profile, and the key now sits in every run's environment,
|
|
261
|
-
|
|
253
|
+
skills, measured 2026-10-02; `codex-review` links that root into its fence home), and `TYPESAFE_API_KEY` passes as
|
|
254
|
+
given under the shared key rule: every `*_API_KEY` except the passed variables its service-facts.txt lists is unset.
|
|
255
|
+
With run hosts in that file, on Linux with codex-cli 0.160.0 or newer, off a recorded version and profile digest
|
|
256
|
+
refusal and, for `codex-exec`, outside every temp root, the profile `jev` reaches the run hosts its service-facts.txt
|
|
257
|
+
lists; a review still writes nothing, and the banner's `jev=` field lists those hosts. Elsewhere the run keeps
|
|
258
|
+
today's flags with network off and `jev=unreachable (<reason>)`. Two residuals stand: codex's server-side
|
|
259
|
+
`web_search` reaches pages outside the profile, and the key now sits in every run's environment, that channel
|
|
260
|
+
included. A codex release that stops recognizing a profile key costs one run per version and profile digest
|
|
262
261
|
(exit 72), while the state file can be written, before the recorded fallback takes over.
|
|
263
262
|
|
|
264
263
|
## How the main agent drives `codex` efficiently
|
|
@@ -283,9 +282,9 @@ See [`references/driving-codex.md`](references/driving-codex.md) for the full pl
|
|
|
283
282
|
sets `approval_policy=never` and the run's own posture explicitly — the profile `jev`'s four overrides,
|
|
284
283
|
or `sandbox_mode=workspace-write` + `sandbox_workspace_write.network_access=false` — chosen afresh on
|
|
285
284
|
each resume. It reads the session id from the sidecar (`--resume-last`) or takes it as an argument.
|
|
286
|
-
- **Network
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
- **Network in exec.** Under the profile `jev` a run reaches the run hosts its service-facts.txt lists;
|
|
286
|
+
under today's flags none. New dependencies and any other network step are installed by hand, then
|
|
287
|
+
codex is re-dispatched.
|
|
289
288
|
- **`codex-review code` precomputes the diff.** The wrapper assembles the change set (repo map, status,
|
|
290
289
|
staged + unstaged diff, untracked file contents) and feeds it in, so codex does not roam the
|
|
291
290
|
filesystem rediscovering it; a clean tree exits 0 before a run is spent. Native `codex review` is
|
|
@@ -311,9 +310,9 @@ The wrappers work in any git repo where `codex` is installed and authenticated.
|
|
|
311
310
|
|
|
312
311
|
## Known limitations
|
|
313
312
|
|
|
314
|
-
- **Network
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
- **Network** in `codex-exec` — the profile `jev` reaches the run hosts its service-facts.txt lists,
|
|
314
|
+
today's flags (`sandbox_workspace_write.network_access=false`) none: codex cannot install dependencies
|
|
315
|
+
— do that by hand, then re-dispatch. The profile runs only on Linux with
|
|
317
316
|
codex-cli 0.160.0 or newer; Windows and macOS keep today's flags until its round-trip is probed there.
|
|
318
317
|
- **No live approvals** — `codex exec` has no TTY, so `approval_policy=never`; an action that would
|
|
319
318
|
need escalation is reported, not approved interactively.
|