Repository navigation
feat(control-ui): approval attention chip + approval history page - #108776
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3827ed1157
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| history = listTerminalOperatorApprovals({ | ||
| cursor: historyParams.cursor, | ||
| limit: historyParams.limit, | ||
| kind: historyParams.kind, | ||
| databaseOptions: params.databaseOptions, |
There was a problem hiding this comment.
Filter approval history through approval access checks
When this method is called by a client that has operator.approvals but no matching reviewer device (or no device at all), it still calls listTerminalOperatorApprovals without client and returns every terminal row. Existing approval.get/approval.resolve route each durable record through canReviewOperatorApproval/canAccessOperatorApproval, and reviewerDeviceIds is the opt-in restriction, so a device can fetch command/plugin presentation, source session, and resolver data for approvals bound to other devices; pass the client into this handler and filter records before building snapshots.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0139d0fa00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .where("status", "!=", "pending") | ||
| .where("resolved_at_ms", "is not", null) | ||
| .orderBy("resolved_at_ms", "desc") |
There was a problem hiding this comment.
Enforce the 30-day cutoff in history reads
When the gateway stays up beyond the retention window and no new approval is inserted or restart occurs, this new history query still pages over every terminal row. The cutoff/prune paths I found run at gateway startup (src/gateway/server-aux-handlers.ts:123-128) and during insert/prune helpers, so a pure approval.history read can return approvals older than the UI's “rolling 30-day window” and the store's retention contract. Add a resolved_at_ms cutoff, or prune before listing, using OPERATOR_APPROVAL_TERMINAL_RETENTION_MS.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c533037c49
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1673,6 +1674,7 @@ export const en: TranslationMap = { | |||
| subtitles: { | |||
| agents: "Workspaces, tools, identities.", | |||
| activity: "Browser-local tool activity summaries.", | |||
| approvals: "Recent exec, plugin, and system-agent approvals.", | |||
There was a problem hiding this comment.
Align the approvals subtitle with the added test
In this commit, subtitleForRoute("approvals") reads this English catalog value, but the added ui/src/app-navigation.test.ts expectation for the same route is Recent terminal operator approvals.. The focused navigation test will fail until the catalog string and assertion use the same copy.
Useful? React with 👍 / 👎.
This comment has been minimized.
This comment has been minimized.
9dbe804 to
999176e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dbe8048f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| nextCursor: encodeOperatorApprovalHistoryCursor({ | ||
| resolvedAtMs: last.resolvedAtMs, | ||
| id: last.id, | ||
| }), |
There was a problem hiding this comment.
When a terminal approval with a long canonical id lands at the page boundary and there are more rows, this cursor embeds the full last.id. Approval ids are accepted without a max length (and this suite explicitly supports overlong ids via transport refs), while ApprovalHistoryResult.nextCursor and ApprovalHistoryParams.cursor are capped at 512 chars, so the history response can fail client validation or the next approval.history request can be rejected before decoding. Use a bounded cursor key (for example the fixed resolution ref or a server-side/tokenized cursor) instead of the unbounded approval id.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 999176edad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** Newest-first page from the retained terminal approval ledger. */ | ||
| export const ApprovalHistoryResultSchema = closedObject({ | ||
| items: Type.Array(TerminalApprovalSnapshotSchema), | ||
| nextCursor: Type.Optional(Type.String({ minLength: 1, maxLength: 512 })), |
There was a problem hiding this comment.
Avoid rejecting generated history cursors
When an exec approval uses a long explicit id, which ExecApprovalRequestParamsSchema permits via unbounded NonEmptyString and ApprovalIdSchema also leaves unbounded, the history cursor encodes the full id into base64 JSON. That can easily exceed 512 characters, so the first page can return a nextCursor that fails validateApprovalHistoryResult in the new UI and also fails validateApprovalHistoryParams on the next request; use a cursor format/limit that cannot exceed the schema or remove this cap.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 7:30 AM ET / 11:30 UTC. Summary Reproducibility: yes. for the patch defects: source inspection shows that a scoped but non-audience client reaches the unfiltered history query, and an unbounded approval id can generate a cursor rejected by the new 512-character protocol schema. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the ledger-backed design, enforce the same reviewer-audience authorization during history pagination, use a cursor whose maximum size matches the protocol contract, add regression coverage for unauthorized devices and long ids, and then provide redacted browser proof of both Control UI flows. Do we have a high-confidence way to reproduce the issue? Yes for the patch defects: source inspection shows that a scoped but non-audience client reaches the unfiltered history query, and an unbounded approval id can generate a cursor rejected by the new 512-character protocol schema. Is this the best way to solve the issue? No, not as currently implemented; the durable-ledger and Control UI direction is appropriate, but history must reuse the existing approval access boundary and a protocol-safe pagination key before it is the narrowest maintainable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 68694599af6f. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (2 earlier review cycles)
|
4ff2aa4 to
3a1cd10
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a1cd100d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "sourceHash": "82b347646c147b6f3560a52a12e7b46718a567547b9dd2abf3be2ccfbbb0f30a", | ||
| "totalKeys": 3421, | ||
| "translatedKeys": 3421, | ||
| "sourceHash": "ef74edf6abf47adb1164b14c6f2c0e2cd82250c0ef791595688701a18d439246", |
There was a problem hiding this comment.
Regenerate locale metadata from the new English catalog
This metadata no longer describes the English catalog in this commit: ui/src/i18n/locales/en.ts hashes to efe57ef00d76606f039ca309755b1c05e5861e4ae990fd29e8d573e8ff99ba50 and flattens to 3459 keys, but the locale meta files still record an older source hash and 3399 keys. scripts/control-ui-i18n.ts/createControlUiLocaleSyncPlan compare the generated expected metadata with these files during pnpm ui:i18n:check, so the i18n check will mark every locale dirty until the metadata is regenerated from the updated source catalog.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6846996241
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| source: { | ||
| ...(record.source.agentId ? { agentId: record.source.agentId } : {}), | ||
| ...(record.source.sessionKey ? { sessionKey: record.source.sessionKey } : {}), | ||
| }, |
There was a problem hiding this comment.
Update Android terminal approval keys
When an Android client uses the canonical approval.resolve or later reloads a terminal approval with approval.get, this new source field makes every terminal snapshot fail Android's exact-key parser: apps/android/app/src/main/java/ai/openclaw/app/GatewayExecApprovals.kt still accepts only resolvedAtMs, reason, and optional decision for terminal statuses. The resolve path then treats the already-applied response as an unknown/malformed outcome and reconciliation reads fail the same way, so Android approval actions can appear stuck or failed until its allowed key set/parser is updated for the new attribution fields.
Useful? React with 👍 / 👎.
28c441e to
7bffac1
Compare
Adds the sidebar approval attention chip and a dedicated approval history page backed by the new approval.history gateway RPC (30-day retention window). Extracts buildSidebarAttentionItems into its own module so the Lit component consumes it as a real cross-module dependency, and wires the strict i18n catalog for the new strings (fallbacks=0).
7bffac1 to
48db449
Compare
|
Merged via squash.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48db449f89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let query = stateDb | ||
| .selectFrom("operator_approvals") | ||
| .selectAll() | ||
| .where("status", "!=", "pending") |
There was a problem hiding this comment.
Terminalize due approvals before history scan
When an approval has passed expiresAtMs but no pending replay or point lookup has run yet—for example a direct approval.history client opens history first, or the Control UI history load races its async pending-approval replay—this scan filters the row out while it is still stored as pending. The other approval read paths reconcile due rows with expireDueOperatorApprovals before reading, so history can temporarily show an empty or incomplete terminal ledger until some unrelated pending read happens; run the same expiry reconciliation before building this query.
Useful? React with 👍 / 👎.
…enclaw#108776) Adds the sidebar approval attention chip and a dedicated approval history page backed by the new approval.history gateway RPC (30-day retention window). Extracts buildSidebarAttentionItems into its own module so the Lit component consumes it as a real cross-module dependency, and wires the strict i18n catalog for the new strings (fallbacks=0).
…enclaw#108776) Adds the sidebar approval attention chip and a dedicated approval history page backed by the new approval.history gateway RPC (30-day retention window). Extracts buildSidebarAttentionItems into its own module so the Lit component consumes it as a real cross-module dependency, and wires the strict i18n catalog for the new strings (fallbacks=0).
What Problem This Solves
Approvals had no persistent surface in the Control UI: a pending approval only appeared as a modal, and there was no way to review past decisions. This adds two things: a sidebar attention chip so a pending approval surfaces where the user already is, and an approval-history page backed by a new gateway RPC over the durable
operator_approvalsledger (who resolved what, when, from which device). Completes the Control UI half of the approvals work (follows #105924, #108505).Why This Change Was Made
Feature A — sidebar attention chip. Reuses the existing overlay
approvalQueuecount (no new RPC): a warning chip appears when the queue is non-empty, clicking it opens the existing in-app approval overlay, and the dismissal signature is the sorted queue ids so a new approval resurfaces a dismissed chip. Flows through the same per-gateway/per-browser dismissal + cross-tab storage machinery as the existing cron/model-auth chips.Feature B — approval history. A new
listTerminalOperatorApprovalsstore query (terminal-only, optional kind filter, keyset cursor on the existingidx_operator_approvals_resolvedindex, newest-first, default 50 / max 100) reads the durable ledger. A new additiveapproval.historygateway RPC (scopeoperator.approvals, registered via the descriptor table so auth is automatic) returns mapped snapshots via the existingbuildApprovalSnapshot, with the terminal snapshot schema extended additively with optional source{agentId, sessionKey}and resolver{kind, id}attribution. A new/settings/approvalspage renders the rolling 30-day history (time, kind, decision/status, reason, source, resolver) with cursor pagination and empty/footer copy stating the retention window. The gateway ledger (all kinds) is the source of truth, not the plugin-specific 1Password audit.Additive protocol only; generated Swift/Kotlin/JSON regenerated. English strings added and the translated i18n sync run (fallbacks=0 across all locales).
User Impact
Operators see pending approvals in the sidebar and can review a 30-day approval history at
/settings/approvals. No behavior change to the approval flow itself.Evidence
plugin-sdk:surface:check, and generators all passed;git diff --checkclean.ui:i18n:checkclean, fallbacks=0 all locales.