Add an optional Codex pet state bridge contract - #369
Open
francis3253161180-maker wants to merge 6 commits into
Open
Add an optional Codex pet state bridge contract#369francis3253161180-maker wants to merge 6 commits into
francis3253161180-maker wants to merge 6 commits into
Conversation
added 6 commits
August 16, 2026 16:11
francis3253161180-maker
marked this pull request as ready for review
August 17, 2026 12:17
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
This draft PR adds a small, platform-neutral state bridge for optional Codex desktop-pet integrations. It keeps a DOM-only path available while restoring an optional app-server enhancement path for pets that need structured execution states.
What changed
codex-state-bridge.mjsfor source policy, selected-sidebar-row arbitration, and the visible running-marker gate.dom,app-server, andauto.commandExecution,fileRead,fileChange,mcpToolCall,webSearch,plan,reasoning,completed,failed, andaborted.pet-runtime.mjsfor normalized, reusable pet state emission.pet-state-bridge.mjswithsync()andingestAppServer()adapters.Design intent
DOM remains authoritative for the selected sidebar conversation and its visible running marker. If the selected row is not running, stale DOM or app-server events cannot revive it; the bridge returns
idle.DOM-only mode is useful when an integration wants zero app-server dependency and only needs visible UI states such as approval or user input. It cannot reliably reproduce every structured execution item, so app-server mode is intentionally preserved for enhanced custom pets. In
auto, app-server events refine the currently selected running conversation and DOM remains the fallback.A visible approval or user-input card takes precedence over a generic reasoning event. Events belonging to another conversation are ignored by the bridge.
The core skin injector does not bundle pet art or start an app-server process. A pet package owns its optional transport/process lifecycle and can fall back to
domwhen app-server is unavailable.Validation
node --checkfor the bridge modulesnode windows/tests/pet-state-bridge.test.mjsnode windows/tests/injector-bootstrap.test.mjsnode windows/tests/injector-one-shot.test.mjsgit diff --checkThis remains a draft so maintainers can confirm the DOM/app-server adapter boundary before a concrete pet package is integrated.