g2: add Codex ask-mode approval UI#9
Open
MKV21 wants to merge 8 commits into
Open
Conversation
bb54e34 to
9750536
Compare
d05247c to
80cca87
Compare
(cherry picked from commit a819948)
97153f2 to
b31c49b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the G2/Web, simulator, and glasses UI for Codex Ask Mode permission requests from the daemon bridge. Sessions that enter
awaiting_approvalnow show the original user prompt, an inline approval card, disabled normal input, and explicit resolution notices for approve, reject, and abort.This also includes a development-only Vite bridge bootstrap via
VITE_OPENVIDE_DEV_HOST_*. It is intended to make local browser/simulator/glasses testing repeatable without re-entering the same bridge host and pairing token after each reload, and is disabled in production builds.This is stacked on #8 and expects the daemon-side
pendingPermissionstate from that PR.Changes
apps/g2/src/screens/chat.tsx— renders Codex permission requests inline with the chat flow, preserves the prompt above the approval card, disables normal input while approval is pending, and keeps approval/reject/abort notices in the right order.apps/g2/src/screens/settings.tsxandapps/g2/src/glass/screens/settings.ts— add a Codex permission mode setting (Auto/Ask) for new Codex sessions.apps/g2/src/hooks/use-create-session.ts,apps/g2/src/screens/tool-picker.tsx, and the glasses session create/open paths — passpermissionMode: "ask"for new or imported Codex sessions when the setting is enabled.apps/g2/src/glass/OpenVideGlasses.tsx— keeps glasses session state synchronized with optimistic permission decisions, rolls back failed permission RPCs, avoids repeated display refreshes from unchanged polling data, and resubscribes without briefly clearing the session view.apps/g2/src/glass/screens/live-output.ts— shows permission request details and terminal approval outcomes on the glasses display without duplicate headings, stale processing text, or duplicated Codex assistant deltas.apps/g2/src/domain/output-parser.tsandapps/g2/src/domain/native-history.ts— parse Codex app-server message/tool events into stable chat output and replace assistant message deltas with final messages without dropping interleaved tool output.apps/g2/src/hooks/use-session-stream.tsandapps/g2/src/hooks/use-sessions.ts— make bridge stream subscription and session polling robust across reloads, reconnects, and background polling.apps/g2/src/contexts/bridge.tsx— supports an optional development-only bridge bootstrap from local Vite environment variables without overriding an existing active host selection.Test plan
./node_modules/.bin/tsc -p apps/g2/tsconfig.jsonnpm --workspace @openvide/g2 run buildnpm test --workspace @openvide/daemonagent_messagedelta/final replacement preserves interleaved tool lines and interleaved message IDs.approve_onceresumes the turn and shows the finalDone.message.awaiting_approvalrestores the approval UI from daemon state andapprove_oncestill resumes the turn.Notes
Autounless the user enablesAskin G2 settings.even-toolkitdynamic/static import warning and the existing large chunk warning.AI disclosure
Parts of this change were drafted by Codex (AI coder) and reviewed by Claude Code (AI reviewer). A human (@MKV21) reviewed, tested in the browser, simulator, and on hardware Even Realities G2 glasses, and approved the final result before submission.