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
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ read-only browser mode, except for the terminal-only `/commands` shortcut.

| Command | Behaviour |
| --- | --- |
| `/usage` | Open Codexometer’s existing usage history. Quota/reset views retain their existing controls and confirmation. |
| `/usage` | Choose **View analytics** or open the reset inventory; `/usage daily`, `/usage weekly` and `/usage cumulative` go straight to a chart. Reset redemption stays terminal-only and requires separate confirmation. |
| `/copy` | Reuse the selected session’s Copy action, copying the full observed reply/activity text. Ineligible or missing text gives feedback. |
| `/theme` | Choose and save a Codexometer display theme; terminal picker or existing browser theme selector. |
| `/exit`, `/quit` | Quit the Codexometer terminal interface; in the browser, leave session detail for Sessions. Codex sessions and the browser server continue running. |
Expand Down Expand Up @@ -2037,14 +2037,14 @@ usage and does not change token totals, quota learning or API-EQ calculations.
| --- | --- |
| `/cd` | Change the selected session’s directory after review and confirmation while idle and with no queued messages. Absolute, session-relative and `~/` paths are supported; success is verified from running configuration. Retains thread ID/history; does not reproduce native project-config reload/fork. |
| `/cwd`, `/pwd` | Read-only aliases showing the running session’s current directory, including during active turns. |
| `/resume` | Search saved session names, preview completed turns and open the selected conversation on a shared Codex 0.170.0+ app-server signed in to ChatGPT. Browser preview is read-only; resuming requires write mode. |
| `/resume` | Search, preview and resume saved sessions on a shared Codex 0.170.0+ app-server signed in to ChatGPT. `/resume <name>` filters the picker; `/resume <full-UUID>` targets the exact session using the usual resume confirmation policy. Browser preview is read-only; resuming requires write mode. |
| `/subagents` | Inspect linked agents and their attributable completed turns without changing the parent composer or approval target. |
| `/ps` | Show and refresh the connected session’s background terminals. This is read-only and does not stop processes. |
| `/rename` | Edit the selected session’s saved name and apply it without a second confirmation by default. Uses Codex’s name API; works during an active turn and does not send a prompt or change model settings. |
| `/goal` | Inspect this session’s objective, official goal state and token budget/usage. Set an objective, edit it, pause, resume or clear it. Native forms `/goal <objective>`, `/goal edit`, `/goal pause`, `/goal resume` and `/goal clear` are supported. The Budget option (also `/goal budget <positive integer\|unlimited>`) changes the total goal-token budget. **Resume after quota recovery** arms a one-shot trigger for that goal. Mutations require confirmation by default. |
| `/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. |
| `/model` | Advertised models, their descriptions and supported reasoning levels. Also accepts `/model [model-id] [--reasoning=<level>] [--speed=<tier>]`. Apply settings for subsequent turns, even during an active turn. Switching models without an explicit speed clears the previous model's speed override. |
| 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. |
| `/plan` | Switch an idle session directly into native Plan mode. Use `/plan <prompt>` to send a prompt in Plan mode in one request. Requires the shared server to advertise Plan mode. |
| `/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. |
Expand Down Expand Up @@ -2267,10 +2267,15 @@ not retried automatically. Read-only web mode offers no command-control endpoint

Codexometer uses a balanced confirmation policy by default. Explicit one-time
approvals, replies, ordinary queue edits, Close All, `/rename`, model/reasoning
selection, advertised speed changes such as `/fast`, and `/plan` apply immediately.
selection, advertised speed changes such as `/fast`, `/plan` (with or without a
prompt), and `/goal pause` apply immediately. Pausing a goal reports if it also
cancels a pending scheduled resume.
They still require an explicit action and a fresh, valid session capability.

Broader permission grants, `/permissions`, `/cd`, quota-profile changes, native
Selecting an already-active `/permissions` preset does nothing. Switching to a
known narrower sandbox applies immediately only when the approval policy and
reviewer do not make it easier to gain additional access. Broader or uncertain
permission changes, `/cd`, quota-profile changes, native
queue deletion, scheduled follow-ups and Send now, and broad/external benchmark
launches keep their review steps. Terminal schedule forms retain their explicit
Confirm Schedule / Save Changes action. Settings affect subsequent work; model
Expand All @@ -2279,15 +2284,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 and granting folder trust. Native denial inspection still precedes an explicit Apply action. |
| `--confirmation none` | Skip extra confirmations, except quota-reset redemption, folder trust and Full Access. 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 and granting folder trust always require confirmation.** Strict
**Quota-reset redemption, granting folder trust and selecting Full Access 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
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ 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.
`--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
quota-reset redemption, terminal folder trust and Full Access 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
Expand Down
8 changes: 4 additions & 4 deletions docs/slash-command-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ Local display commands remain daemon-independent. Server-backed menus use a boun
| `/goal` | Session adapter | Done | — | Session-scoped `thread/goal/get`, `set`, `clear`; native objective/edit/pause/resume/clear forms plus a token-budget editor. **Resume after quota recovery** is a local, one-shot trigger for an active or usage-limited goal, not a scheduled slash message. It requires observed goal/quota state and a live idle shared app-server session before dispatch. Fresh review/verification, default mutation confirmation, live goal notifications and stale-safe snapshot fallback shared by TUI/web. Goal state follows row statusline fields and precedes full-detail controls. Requires a goal-enabled shared app-server. |
| `/cd <path>` | Implemented with narrower semantics | P1 | Very high | Confirmed `thread/settings/update`, sending only `threadId` and `cwd`. Requires idle/local session, empty queue, no pending approval and an existing directory. Resolves relative paths from the running session directory, expands `~`/`~/`, rechecks symlinks and verifies the result from running configuration. No write retries. See the semantics below. Proposed next increment: destination project-context reload with trust/permission validation and a verified conversation handoff. Reuse the lifecycle foundation below; native-client cooperation may still be necessary. |
| `/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. |
| `/model` | Session adapter | Done | — | Live model/reasoning catalogue and inline `/model [model-id] [--reasoning=<level>] [--speed=<tier>]`. 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. Changing model without choosing a speed clears its explicit speed override. Session-only scope is intentional. |
| `/plan` | Session adapter | Done | — | Switch an idle session directly to the advertised native Plan mode. An inline prompt is bound to Plan mode in a single `turn/start` rather than a settings write followed by an independent prompt. |
| `/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. |
| `/mcp` | Browse only | P2 | High | `mcpServerStatus/list` and tool help. No `/mcp login`, including 0.171's optional `--environment` selector, resource browser or arbitrary tool invocation. Proposed next increment: server- and environment-aware login/status and verbose inspection. Arbitrary tool execution remains a separate reviewed workflow. |
| `/hooks` | Browse only | P3 | High | `hooks/list`; on 0.166+ discovery is scoped to the loaded thread and its execution environments, with supplied environment attribution. Older servers retain directory-scoped discovery; genuine server errors do not become a different inventory. No lifecycle-hook editor or configuration-write review. Proposed next increment: a scope-aware editor with preview and reload handling. |
| `/experimental` | Browse only | P3 | Medium | `experimentalFeature/list`. Enablement changes process/configuration scope, rather than a single session; no mutation UI. Proposed next increment: review an advertised enablement change with its process/configuration scope and refresh/restart effects made clear. |
| `/usage` | Local equivalent | Done | — | Opens the existing Codexometer usage-history view. Existing quota/reset views and their confirmation flows are retained. No account mutation is sent by the alias. |
| `/resume` | Implemented | Done | — | Shared Codex 0.170.0+ with ChatGPT sign-in: search saved sessions by name, preview recent completed turns and explicitly open the selected thread in Sessions detail without sending a prompt. Read-only web can browse and preview; resuming requires write mode. |
| `/usage` | Local equivalent | Done | — | Analytics/reset navigation and `daily`, `weekly` and `cumulative` shortcuts. Terminal redemption still uses the guarded reset screen; the browser reset inventory is read-only. No account mutation is sent by the alias. |
| `/resume` | Implemented | Done | — | Shared Codex 0.170.0+ with ChatGPT sign-in: browse and preview saved sessions, prefill the picker with `/resume <name>`, or target one account-verified session with `/resume <full-UUID>`. The shortcut does not send a prompt or bypass strict confirmation. Read-only web can browse and preview; resuming requires write mode. |
| `/ps` | Implemented | Done | — | Lists background terminals for the selected connected session using `thread/backgroundTerminals/list`, with refresh. Read-only in both interfaces; does not stop processes. |
| `/subagents` | Implemented | Done | — | Opens a read-only picker for linked agents and attributable child transcripts; the parent remains the target for composing and approvals. |
| `/copy` | Local equivalent | Done | — | Reuses the selected session’s Copy action and complete observed reply/activity payload. Missing or ineligible text gives feedback. Historical-fragment selection remains outside this increment. |
Expand Down
39 changes: 38 additions & 1 deletion internal/codex/session_auto_review_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,16 @@ func TestNativePermissionPickerUsesCLIOrderAndUpdatesCompletePreset(t *testing.T
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 != "" {
active := i == selected
if choice.Label != want[i].label || choice.Selected != active || choice.NoOp != active || choice.Action == active || choice.Reversible || choice.Next != "" {
t.Fatalf("unexpected preset at %d: %+v", i, choice)
}
if choice.AlwaysConfirm != (!active && choice.Label == "Full Access") {
t.Fatalf("unexpected mandatory confirmation: %+v", choice)
}
}
if err := p.ExecuteSessionCommand(ctx, "one", menu.Path, menu.Revision, menu.Choices[selected].ID); err == nil {
t.Fatal("selecting the current preset must not issue a write")
}
if err := p.ExecuteSessionCommand(ctx, "one", menu.Path, menu.Revision, menu.Choices[apply].ID); err != nil {
t.Fatal(err)
Expand All @@ -344,6 +351,36 @@ func TestNativePermissionPickerUsesCLIOrderAndUpdatesCompletePreset(t *testing.T
t.Fatalf("wrong complete update for %s: %v", preset.label, got)
}
}
inline, err := p.SessionCommands(ctx, "one", "permissions :danger-full-access")
if err != nil || len(inline.Choices) != 1 || !inline.Choices[0].AlwaysConfirm {
t.Fatal("inline Full Access must also require confirmation", inline, err)
}
}

func TestPermissionChangesSkipReviewOnlyForKnownNarrowing(t *testing.T) {
for _, tc := range []struct {
name, from, to, policy, newPolicy, reviewer, newReviewer string
want bool
}{
{"workspace to read-only", ":workspace", ":read-only", `"on-request"`, `"on-request"`, "user", "user", true},
{"leave full access", ":danger-full-access", ":workspace", `"never"`, `"on-request"`, "user", "user", true},
{"reviewer also narrowed", ":workspace", ":read-only", `"on-request"`, `"on-request"`, "auto_review", "user", true},
{"reviewer weakened", ":workspace", ":read-only", `"on-request"`, `"on-request"`, "user", "auto_review", false},
{"sandbox expanded", ":read-only", ":workspace", `"on-request"`, `"on-request"`, "user", "user", false},
{"reviewer-only edit", ":workspace", ":workspace", `"on-request"`, `"on-request"`, "auto_review", "user", false},
{"new escalation path", ":workspace", ":read-only", `"never"`, `"on-request"`, "user", "user", false},
{"sandbox permissions unknown", "managed", ":read-only", `"on-request"`, `"on-request"`, "user", "user", false},
{"approval policies incomparable", ":workspace", ":read-only", `{"granular":{}}`, `"on-request"`, "user", "user", false},
{"reviewer unknown", ":workspace", ":read-only", `"on-request"`, `"on-request"`, "", "user", false},
} {
t.Run(tc.name, func(t *testing.T) {
current := &sessionPermissions{Profile: &struct{ ID string }{tc.from}, Policy: json.RawMessage(tc.policy), Reviewer: tc.reviewer}
params := map[string]any{"permissions": tc.to, "approvalPolicy": json.RawMessage(tc.newPolicy), "approvalsReviewer": tc.newReviewer}
if got := permissionChangeNarrows(current, params); got != tc.want {
t.Fatalf("direct = %v, want %v", got, tc.want)
}
})
}
}

func TestNativePermissionPickerHonoursRestrictions(t *testing.T) {
Expand Down
Loading
Loading