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
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1481,10 +1481,14 @@ This does not build a separate on-disk index or change the live Filter box.
In write-enabled web mode, choose **New session** beside **Saved sessions**.
With the same shared server, this opens a blank composer without creating a
Codex thread. Check the working directory, then send the first message to
start it using Codex's normal defaults. The selected directory must already
be explicitly trusted in Codex's user configuration; use the same directory
where you approved folder trust in Codex (usually the repository root).
Codexometer does not grant trust. Type **`/resume`** or choose **Resume**
start it using Codex's normal defaults. In the terminal, if Codex has no trust
decision for the directory, **Trust & send** shows the exact path and asks
you to save trust before starting. **Esc** goes back without losing the draft.
Trusted folder settings and hooks can run before the first message; this
confirmation is required even with `--confirmation none`. Codexometer never overrides
an untrusted decision or grants trust to a broader path. If Codex expects a
Git repository root, select that root. The browser still requires a directory
already explicitly trusted in Codex. Type **`/resume`** or choose **Resume**
(**Saved sessions** in web mode) in the draft to open an existing conversation instead.
Closing the picker returns to your draft. Closing the draft before sending
creates nothing. Strict confirmation mode reviews the exact folder and first
Expand Down Expand Up @@ -2041,22 +2045,23 @@ usage and does not change token totals, quota learning or API-EQ calculations.
| `/model` | Advertised models, their descriptions and supported reasoning levels. Save the next-turn setting in Codex immediately, even while a turn is running. Choosing a model resets its explicit speed override to the server default. |
| Advertised speed commands, such as `/fast` | Show the default speed and every advertised tier in one list, initially highlighting the current speed. Up/Down highlights; **Enter APPLY** or clicking a choice applies it without a second confirmation by default. IDs and descriptions come from the current model's catalogue; no tier IDs are guessed. The changed speed is verified before success is reported. |
| `/plan` | Advertised collaboration modes, using Codex's built-in mode instructions. |
| `/permissions` | Native permission profiles, approval policies and reviewer selection, subject to Codex's managed requirements. Also accepts `/permissions <profile-id> [--approval-policy=<policy>] [--reviewer=user\|auto_review]`. Changes are verified against the running session. |
| `/permissions` | The same starter choices as Codex CLI: **Ask for approval**, **Approve for me**, **Full Access**, **Read Only**, then any custom profiles. Availability follows Codex's requirements. Also accepts `/permissions <profile-id> [--approval-policy=<policy>] [--reviewer=user\|auto_review]`. Changes are verified against the running session. |
| `/approve` | Review a recently observed native Auto-review denial and record consent for **one retry of that exact action**. It does not run the action directly; the retry still passes through Auto-review. |
| `/skills`, `/apps`, `/mcp`, `/hooks`, `/experimental` | **Browse-only** live inventories and supplied help, including MCP tool descriptions. Invoke/configure these through Codex. |
| `/help` | Available command families. Unsupported or empty catalogues are omitted. |

**Native Auto-review:** use `/permissions` → **Reviewer** to choose **Human**
or **Auto-review** for the selected session. This does not change its sandbox.
The server must expose reviewer settings, enable `guardian_approval`, and permit
the choice under its managed requirements. For example:
**Native Auto-review:** choose **Approve for me** in `/permissions` to use
workspace permissions with Codex's native reviewer, or **Ask for approval**
to use workspace permissions with human review. Like the Codex CLI, the picker
only shows **Approve for me** when `guardian_approval` is enabled. Managed
requirements can make a displayed choice unavailable. To apply a specific
profile, policy and reviewer, use inline arguments, for example:

```text
/permissions :workspace --approval-policy=on-request --reviewer=auto_review
```

Profile IDs come from the live catalogue; `:workspace` is an example, not a
hard-coded fallback. Quoted arguments and native granular policy JSON are
Profile IDs are checked against the live catalogue. Quoted arguments and native granular policy JSON are
accepted. The menu spells out which kinds of approval **prompts** a managed
policy enables or disables; enabling a prompt does not grant permission.
Profile, policy and reviewer changes target subsequent turns. An
Expand Down Expand Up @@ -2274,15 +2279,15 @@ and speed choices can affect quota consumption or API cost.
| Setting | Behaviour |
|---|---|
| Omitted | Balanced default: confirm higher-impact actions. |
| `--confirmation none` | Skip extra confirmations, except quota-reset redemption. Native denial inspection still precedes an explicit Apply action. |
| `--confirmation none` | Skip extra confirmations, except quota-reset redemption and granting folder trust. Native denial inspection still precedes an explicit Apply action. |
| `--confirmation require` | Confirm every substantive action; navigation and viewing stay immediate. |

```sh
codexometer --confirmation none
codexometer --web --web-control --confirmation require
```

**Quota-reset redemption always requires confirmation, in every mode.** Strict
**Quota-reset redemption and granting folder trust always require confirmation.** Strict
mode also reviews ordinary terminal replies, active-turn steer/queue/interrupt
actions, queued-message edits and trigger deletion. Reviews bind the exact target,
payload and live capability, expire, and can be cancelled without discarding the
Expand Down
12 changes: 9 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,22 @@ reset redemption still have no routes.
Reversible session-local slash changes (name, model/reasoning, advertised speed,
and collaboration mode) apply on explicit selection without a second UI click.
Permissions, directories and unknown actions remain guarded by default.
`--no-confirm` is a launch-only opt-out from other Codexometer confirmation clicks;
quota-reset redemption remains guarded even with this option. It does not select
`--confirmation none` is a launch-only opt-out from other Codexometer confirmation clicks;
quota-reset redemption and terminal folder trust remain guarded. It does not select
approvals automatically, change Codex sandbox policies, enable read-only web
control routes or bypass server-side preparation/commit, source freshness,
revision, one-use capability or replay validation. Browser preparation and commit
remain distinct protected requests even when one user action runs both phases.
Never infer an action's risk from its display label: the shared adapter marks
only an explicit allowlist of reversible RPC methods/fields. Unknown metadata
requires confirmation by default. Test both policies, including unavailable
actions, failed preparation, stale/replaced requests and the reset exception.
actions, failed preparation, stale/replaced requests and the mandatory confirmations.

Folder trust can only be granted in the terminal's New Session draft. Confirmation
must show the full canonical path and the warning about project settings and hooks.
Never grant trust implicitly, expand it to a parent path, override an untrusted
decision, or expose the write in web mode. Use Codex's version-checked user config
RPC and verify effective trust before sending `thread/start` or the first prompt.

Prepared bodies are limited to 64 KiB and each answer to 4,096 characters. At most
one prepared action is retained for 30 seconds per server; replacement invalidates
Expand Down
4 changes: 2 additions & 2 deletions docs/slash-command-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Aliases on one row share the rating and implementation. Lifecycle commands share
- Provider-aware model/speed discovery and threshold validation on Codex 0.169+, plus thread/environment-aware `/hooks` discovery on 0.166+.
- In the terminal and writable web composer, a space after a supported command opens its parameter list. Type `/goal resume` to narrow it to **Resume goal**, or type through the model and reasoning choices. Browsing does not run a command.
- Reversible settings normally need no extra confirmation. Choose `/model` during work to set the model for the next turn without interrupting the current one. The launch confirmation policy does not override Codex's permissions or mandatory human checkpoints.
- The Sessions list now has a **New session** draft (terminal **N**) and a separate saved-session picker (terminal **R** or `/resume`). The first send starts a thread in an already trusted working directory. Read-only web can browse saved sessions; write-enabled web can also start or resume them.
- The Sessions list now has a **New session** draft (terminal **N**) and a separate saved-session picker (terminal **R** or `/resume`). The first send starts a thread in a trusted working directory. In the terminal, the draft can ask you to trust an undecided folder before sending. Read-only web can browse saved sessions; write-enabled web can also start (in an already trusted folder) or resume them.
- `/subagents` inspects linked agents without retargeting the parent composer. `/ps` lists and refreshes background terminals without stopping them. Both are read-only.

Local display commands remain daemon-independent. Server-backed menus use a bounded, memory-only catalogue tree; execution always revalidates fresh server options. These delivered items are not future roadmap work.
Expand All @@ -51,7 +51,7 @@ Local display commands remain daemon-independent. Server-backed menus use a boun
| `/pwd`, `/cwd` | Implemented aliases | Done | — | Read-only `thread/resume` **without overrides** reports the running directory, including during active turns. Captured `thread/read.cwd` metadata is not used as the answer. The session directory/footer also follows live directory reads and settings notifications. |
| `/model` | Session adapter | Done | — | Live model/reasoning catalogue; send one verified `thread/settings/update` immediately on idle or working sessions, for subsequent turns only. No Codexometer-side queue or automatic retry. Fresh provider/settings/catalogue checks precede the write. The balanced default needs no extra confirmation. Selecting a model clears its explicit speed override. Session-only scope is intentional; no native persistent-default editor is proposed. |
| `/plan` | Partial | P2 | Medium | Advertised collaboration-mode selection; no native optional prompt argument. Proposed next increment: explicit review of an inline plan prompt and confirmed mode/prompt submission without losing the draft. |
| `/permissions` | Session adapter | Done | — | Native allowed profiles, approval policies and Human/Auto-review reviewer selection. Supports `/permissions <profile-id> [--approval-policy=<policy>] [--reviewer=user\|auto_review]`, shell-style quoting and native granular policy JSON. May update subsequent-turn settings during work, but retained/overflowed human requests and native approval/input waits block writes. Managed requirements and the `guardian_approval` feature govern availability. Requested settings are read back; uncertain writes are not retried. Browser edits invalidate prepared/in-flight inline reviews. Older servers without reviewer metadata retain profile-only controls; no global configuration editor is implied. |
| `/permissions` | Session adapter | Done | — | Native preset order: Ask for approval, Approve for me, Full Access, Read Only, then custom profiles. Supports `/permissions <profile-id> [--approval-policy=<policy>] [--reviewer=user\|auto_review]`, shell-style quoting and native granular policy JSON. May update subsequent-turn settings during work, but retained/overflowed human requests and native approval/input waits block writes. Managed requirements and the `guardian_approval` feature govern availability. Requested settings are read back; uncertain writes are not retried. Browser edits invalidate prepared/in-flight inline reviews. Older servers without reviewer metadata retain profile-only controls; no global configuration editor is implied. |
| `/approve` | Session adapter | Done | — | `thread/approveGuardianDeniedAction` records consent for one exact recent native denial, not direct execution. The retry still passes through Auto-review; critical-risk and mandatory human checks are not bypassed. Full action/rationale inspection precedes consent even with `--confirmation none`. Inventories and assessment display are root-thread-scoped, memory-only and connection-local: up to ten denials per thread and 256 tracked threads, with spent-consent replay protection. Unknown/incomplete actions stay in Codex. Read-only web displays assessments but cannot send consent. |
| `/skills` | Browse only | P2 | Medium | `skills/list` inventory/help. No invocation or configuration flow; `skills/config/write` exists but needs scope/review UI. Proposed next increment: invoke an advertised skill through structured input after review. Configuration/enablement writes are a separate High-complexity extension. |
| `/apps` | Browse only | P3 | High | `app/list` inventory/help. Installation, linking and authentication workflows are absent. Proposed next increment: a guided linking/authentication workflow with return/cancellation handling; reuse upstream flows rather than inventing installation semantics. |
Expand Down
77 changes: 76 additions & 1 deletion internal/codex/session_auto_review_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,87 @@ func configureNativePermissions(f *quotaDaemonFixture) {
f.reviewers = map[string]string{"one": "user"}
f.approvalPolicies = map[string]any{"one": "on-request"}
f.catalogues = map[string]map[string]any{
"permissionProfile/list": {"data": []any{map[string]any{"id": ":workspace", "description": "Write inside the project.", "allowed": true}}},
"permissionProfile/list": {"data": []any{
map[string]any{"id": ":read-only", "description": nil, "allowed": true},
map[string]any{"id": ":workspace", "allowed": true},
map[string]any{"id": ":danger-full-access", "description": nil, "allowed": true},
}},
"configRequirements/read": {"requirements": nil},
"experimentalFeature/list": {"data": []any{map[string]any{"name": "guardian_approval", "enabled": true}}},
}
}

func TestNativePermissionPickerUsesCLIOrderAndUpdatesCompletePreset(t *testing.T) {
p, f := newQuotaDaemon(t)
configureNativePermissions(f)
ctx := t.Context()
want := []struct{ label, profile, policy, reviewer string }{
{"Ask for approval", ":workspace", "on-request", "user"},
{"Approve for me", ":workspace", "on-request", "auto_review"},
{"Full Access", ":danger-full-access", "never", "user"},
{"Read Only", ":read-only", "on-request", "user"},
}
for selected, apply := range []int{1, 2, 3, 0} {
menu, err := p.SessionCommands(ctx, "one", "permissions")
if err != nil || len(menu.Choices) != len(want) {
t.Fatalf("expected four native options: %+v %v", menu.Choices, err)
}
for i, choice := range menu.Choices {
if choice.Label != want[i].label || choice.Selected != (i == selected) || !choice.Action || choice.Reversible || choice.Next != "" {
t.Fatalf("unexpected preset at %d: %+v", i, choice)
}
}
if err := p.ExecuteSessionCommand(ctx, "one", menu.Path, menu.Revision, menu.Choices[apply].ID); err != nil {
t.Fatal(err)
}
f.mu.Lock()
got, count := f.writes[len(f.writes)-1], len(f.writes)
f.mu.Unlock()
preset := want[apply]
if count != selected+1 || len(got) != 4 || got["threadId"] != "one" || got["permissions"] != preset.profile || got["approvalPolicy"] != preset.policy || got["approvalsReviewer"] != preset.reviewer {
t.Fatalf("wrong complete update for %s: %v", preset.label, got)
}
}
}

func TestNativePermissionPickerHonoursRestrictions(t *testing.T) {
p, f := newQuotaDaemon(t)
configureNativePermissions(f)
ctx := t.Context()
menu, err := p.SessionCommands(ctx, "one", "permissions")
if err != nil || len(menu.Choices) != 4 {
t.Fatal(menu, err)
}
f.mu.Lock()
profiles := f.catalogues["permissionProfile/list"]
profiles["data"] = append(profiles["data"].([]any), map[string]any{"id": "custom", "allowed": true})
f.catalogues["configRequirements/read"]["requirements"] = map[string]any{
"allowedPermissionProfiles": map[string]bool{":workspace": true, ":read-only": true, "custom": true},
"allowedApprovalsReviewers": []string{"user"},
}
f.mu.Unlock()
if err := p.ExecuteSessionCommand(ctx, "one", menu.Path, menu.Revision, menu.Choices[2].ID); err == nil {
t.Fatal("stale Full Access selection ignored managed requirements")
}
menu, err = p.SessionCommands(ctx, "one", "permissions")
if err != nil || len(menu.Choices) != 5 || menu.Choices[4].Label != "custom" || !menu.Choices[4].Action {
t.Fatal(menu, err)
}
for _, i := range []int{1, 2} {
if o := menu.Choices[i]; o.Action || o.Unavailable == "" {
t.Fatalf("blocked preset should be visible but not actionable: %+v", o)
}
}
f.mu.Lock()
f.catalogues["experimentalFeature/list"] = map[string]any{"data": []any{map[string]any{"name": "guardian_approval", "enabled": false}}}
writes := len(f.writes)
f.mu.Unlock()
menu, err = p.SessionCommands(ctx, "one", "permissions")
if err != nil || len(menu.Choices) != 4 || menu.Choices[1].Label != "Full Access" || writes != 0 {
t.Fatal("Guardian disabled should hide Approve for me and no settings should be written", menu, err)
}
}

func TestNativePermissionsInlineAndVerification(t *testing.T) {
p, f := newQuotaDaemon(t)
configureNativePermissions(f)
Expand Down
Loading
Loading