Skip to content

Deliver the canonical CodexUI bridge client - #47

Merged
VolkerChristian merged 36 commits into
masterfrom
codex2-master
Aug 24, 2026
Merged

Deliver the canonical CodexUI bridge client#47
VolkerChristian merged 36 commits into
masterfrom
codex2-master

Conversation

@VolkerChristian

@VolkerChristian VolkerChristian commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

  • select the production CodexUI middle region through CMake from focused ShellWidget, projection, conversation, composer, thread, and Inspector components
  • derive the complete conversation from PresentationModel through one typed, deterministic projection with stable thread/turn/item identities
  • keep app-server state and processing order authoritative while CodexUI owns only local interaction state such as selection, pending submissions, drafts, and scroll ownership
  • retain the established three-pane appearance, composer styling, card styling, Inspector surfaces, status bars, and one-line CodexUI brand lockup

Interaction contract

Thread routing and prompt lifecycle

  • Send and Steer target only the visibly selected stable thread; creating a thread requires the explicit New Thread flow
  • prompt admission immediately creates a muted-blue pending card while leaving the composer enabled for further input
  • only the correlated turn.start or turn.steer result acknowledges a prompt; conversation events cannot infer acknowledgment
  • every submission carries a unique clientUserMessageId; the local and authoritative forms share one stable visual identity
  • pending cards sweep left and right while waiting and show a 500 ms left-to-right accepted transition after a real callback
  • prompts queue in order with one operation in flight per thread, while different threads dispatch independently
  • pending prompts and retained Plan, Agents, Changes, Requests, and scroll state survive thread switching
  • selected threads hydrate once per connection generation; stale reads cannot replace newer state
  • failed hydration keeps the composer draft intact and requires Reload before admission
  • a thread-not-found result receives one bounded resume-and-retry with the same client identity
  • connection and recovery ownership are rechecked at queued dispatch time, so disconnects remain queued and resume cannot overlap hydration or another turn operation

Conversation and scrolling

  • group conversation content at one semantic level: app-server turns containing items in exact server order
  • update stable cards in place; identical projections are visual no-ops
  • measure all card types before committing geometry changes and settle each visible update in one layout transaction
  • smoothly follow new content only while the user is at the bottom
  • resume following for local prompt admission when the only pause came from composer overlay growth, revealing the complete pending card without overriding explicit user scrolling
  • pause immediately on user upward scrolling and preserve the first visible stable card plus its pixel offset through appends, reflow, history changes, and thread navigation
  • make the complete center region wheel and touchpad sensitive while nested scrollable controls retain directional ownership; mouse-wheel and touchpad gestures use Qt native platform/device scrolling while CodexUI records only follow/pause ownership
  • retain an 80-item initial presentation window with explicit incremental history loading

Composer and Command execution

  • keep the canonical composer reserve fixed and overlay multiline growth over the message viewport
  • add matching trailing conversation space so the final message remains reachable without shifting the viewport; remove it when the composer shrinks
  • hide Command execution output surfaces when no visible output exists
  • grow visible output from zero to a 220 px maximum, show a styled scrollbar only when required, follow the nested bottom independently, and pause when the user scrolls upward

Inspector and chrome

  • retain Plan, Agents, Changes, Requests, and Info state across navigation and hydration
  • use consistent styled scrollbars for State and Protocol
  • keep the Protocol log bounded and place statistics below the log
  • label operational cards Command execution
  • align the CodexUI title and Codex agent workspace subtitle in one horizontal lockup

Source structure

src/greenfield/codex/
  ShellWidget                    protocol/application coordinator
  middle/MiddleTypes             typed immutable projection values
  middle/PromptCoordinator       per-thread submission state machine
  middle/ConversationProjection  pure model-to-view projection
  middle/ConversationCards       stable typed card widgets
  middle/ConversationView        geometry and scroll owner
  middle/ComposerPane            composer and overlay-height source
  middle/ThreadPane              stable thread selection/actions
  middle/InspectorPane           retained Plan/Agents/Changes/Requests/Info
  middle/MiddleRegionWidget      three-pane composition and wheel routing

Verification

cmake -S . -B build-codex
cmake --build build-codex -j2
QT_QPA_PLATFORM=offscreen ctest --test-dir build-codex --output-on-failure

100% tests passed, 0 tests failed out of 6

The six production-boundary tests cover socketpair transport, presentation normalization/reduction, typed projection and prompt correlation, middle-region scrolling and card geometry, layout/composer/Inspector behavior, and real ShellWidget/FrontendSession integration. The four middle-region tests passed ten consecutive full-suite repetitions. The final shell integration scenario, including disconnect-at-dispatch and navigation-during-resume interleavings, passed 30 consecutive runs. The layout boundary also covers thread-list reordering without reusing Qt-owned index widgets; the focused layout scenario passed 125 normal runs, 50 ASan runs, and Valgrind with zero memory errors. Production and tests also build cleanly with -Wall -Wextra -Wpedantic -Werror; git diff --check passes.

Runtime boundary

codex-bridge remains a stateless router. CodexUI adds no semantic cache or persistence layer. Attachment inputs remain native app-server local-path references. Runtime connection overrides are session-only and retain SNode.C configuration as startup authority.

@VolkerChristian VolkerChristian changed the title Introduce the slim codex2 CodexUI architecture Replace legacy CodexUI with the canonical bridge client Aug 24, 2026
@VolkerChristian

Copy link
Copy Markdown
Member Author

Follow-up pushed through 7f21b7a:

  • fixes configuration-only teardown without constructing the Qt shell
  • scopes presentation refreshes and reconciles live items by stable identity
  • bounds the rendered conversation window while retaining complete authoritative model state
  • lazily bounds State and Protocol rendering
  • enforces wrapping and the documented complete Qt scrollbar contract
  • removes machine-specific build-directory paths from documentation

Verification: codexui-socketpair-contract and codexui-presentation-pipeline pass. Live verification against the large production thread settled near 185 MiB RSS with no sustained CPU load; State and Protocol remained responsive.

@VolkerChristian VolkerChristian changed the title Replace legacy CodexUI with the canonical bridge client Deliver the canonical CodexUI bridge client Aug 24, 2026
@VolkerChristian

Copy link
Copy Markdown
Member Author

Follow-up ab3a6a5 removes the remaining whole-card replacement path for Command execution updates. Streaming output, output-widget creation/removal, status, exit code, and metadata now mutate the retained outer card in place; identical visible fingerprints touch neither the widget nor conversation scroll state. The Qt regression suite now checks pointer identity, fixed viewport geometry, and unchanged scroll value across output, completion, and nonvisual events. Full local result: 3/3 tests passed.

@VolkerChristian

Copy link
Copy Markdown
Member Author

Fixed the delayed/missing streamed-card regression in cc7e1e9. Some app-server item lifecycle notifications carry the stable item identity only as item.id; normalization now copies that identity into scope.itemId before presentation events are emitted. This keeps incremental rendering keyed correctly, so streamed cards appear without waiting for a later prompt/full refresh.

Scope is intentionally narrow: 6 net production lines plus a regression test. No new activity indicator or other UI behavior was added. All 3 local test targets pass, including the conversation scrolling/card update suite.

@VolkerChristian

Copy link
Copy Markdown
Member Author

Follow-up fix 16c1033 corrects the ordering regression exposed by immediate streamed-card delivery. Incremental insertion no longer treats pending prompt cards as end markers, so new materialized cards remain after the locally admitted prompt and before the trailing spacer. The production change removes the prompt-marker branches (5 lines reduced to 1 condition). Added regression coverage verifies both card ordering and fixed viewport geometry; all 3 local test suites pass.

@VolkerChristian
VolkerChristian force-pushed the codex2-master branch 8 times, most recently from 9622143 to b757368 Compare August 24, 2026 22:38
@VolkerChristian
VolkerChristian merged commit 8860e0f into master Aug 24, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant