Repository navigation
feat(chat): restyle omp's ask dialogs and forms - #467
Closed
andrebrait wants to merge 34 commits into
Closed
andrebrait wants to merge 34 commits into
andrebrait wants to merge 34 commits into
Conversation
Start of a custom omp entry that would host ompweb sessions over a local socket. Paused: omp collab already covers most of the design, and the direction (collab guest, custom build or hybrid) is pending.
runner/ is ompweb's own omp build on pinned @oh-my-pi/pi-coding-agent 18.19.0. src/cli.ts stands in for upstream cli.ts as the process entry and swaps the launch command for one whose session factory (src/session.ts) shares every session through the host's loopback collab relay (runtime overrides only) and attaches the NDJSON control socket (src/control.ts: get_state, set_model). src/relay.ts is the loopback relay; scripts/ holds the guest and host probes. Verified: --smoke-test ok; stock and runner TUIs joined by the guest probe; a guest prompt raised an ask that the guest answered; set_model over the control socket switched the TUI model and reached the guest as entry+state.
Drop the collab relay, overrides and guest probe. The session factory now connects src/channel.ts: hello with the session file, every AgentSession event, commands (get_state, set_model, prompt, abort) against the same AgentSession the TUI drives, and dialogs raced between the TUI and the host by wrapping the tool UI context (first answer wins, the other side closes). Verified: --smoke-test ok; a host-sent prompt opened an ask whose whole HTML form (checked state included) reached the host as formDialog; the host answer closed the TUI form; a TUI answer sent ui_end to the host.
src/commands/ holds one CommandTable and FrameTable per group (prompting, model, session, tools, agents) behind a shared CommandContext; the channel dispatches cmd frames by op and other host frames by t.
Agents were cut off mid-task; this preserves their partial edits (runner headless/events/correlation, ompweb process/daemon/manager/auth, TUI attach socket, release/smoke), plus the spec and DESIGN/AGENTS updates. Not verified as a whole.
Skill diagnostics came from an unmerged omp PR that the pinned runner lacks; the feature, its setting toggle and docs are removed. Root tsconfig excludes runner/, which has its own. E2E (server+daemon+compiled runner): prompt, whole ask form with pre-checked default, set_model+edit_message and TUI attach all passed.
…layout Fake omp children in host tests speak hello/cmd/res/event instead of RPC; RemoteRpcTransport tags link samples from hello/session frames. The web ask form adds the automatic Other choice per radio/checkbox group, as omp does.
Fake hosts and workers in agent-tools, api-contract, message-outbox-review, outbox-handoff, session-resume and session-routes speak hello/cmd/res/event; the rename-during-edit test holds a native edit_message command. The late second RPC response case is gone: the channel reports it as prompt_error.
Both handlers existed but were missing from the command table, so the daemon's event filter and the outbox status probe got unknown-command errors.
The root suite ignores runner/** (its deps live in runner/node_modules); runner gets a typecheck and bun test job on PRs that touch it. zh-TW, added on main, still carried the removed skill-diagnostics keys.
…p dirs npm test lists the app directories instead of ignoring runner/** (the ignore glob missed Windows paths). Smoke needs a real runner: CI builds it first, and packed-install smokes pass it with --omp until the per-platform runner packages are published.
…ing HOME omp's daemon broker, LSP mux and embedding server detach and outlive the session by design; on Windows they keep the throwaway HOME locked.
…ng it The server closes the peer dialog without waiting for omp, so the child's answer record can land after the cancel frame (seen on Windows CI).
A freshly copied runner binary's first start on Windows waits on the antivirus scan; the 10 s probe reported omp as missing for the whole daemon session. Smoke waits up to 60 s for the link.
The runner cannot add clientMessageId to omp's entries, so it journals
{clientMessageId, entryId} in a custom entry. The session reader now takes
the id from either source, on the active branch only, for outbox
reconciliation, full context and history pages.
Runner: headless mode boots through runRootCommand's runSessionHost hook (upstream PR pending; carried as a Bun patch of the exact diff) instead of swapping omp's rpc-ui mode with a build plugin, and no runner module imports omp's RPC helpers any more (prompt results, goals, session events and settle, message paging, host tools/URIs, btw, dictation, live, subagents are ported onto omp's non-RPC modules). ompweb: the server passes the runner's ui_request/ui_end/ui frames through unchanged and the browser renders each omp dialog method from its own arguments, answering ui_response with the exact omp return value; the extension_ui_* translation is gone.
Daemon: unowned res frames are dropped and startup configure is
fire-and-forget (a slow extension startup no longer resolves the web's
commands with stray replies); a TUI runner cannot attach to a session that
already has a live channel ({t:"refused"}); the host link moves to protocol
v10 (MIN = VERSION), deleting spawnLegacy, legacy channels and every older
version gate; a restarted server sees each event once and in order
(continuous rejoin); the host socket is created under umask 0177; numeric
string dialog ids are normalised; dead capability and lifecycle plumbing
removed.
Runner: only interactive TUIs dial the host, redialling stops after a
refusal, no dialling on Windows yet, open dialogs are re-sent after a
redial and ui_end follows a failed local dialog; tests now kill the
reviewer's mutants and cover edit_message.
Browser: agent forms with controls named like HTMLFormElement members
still submit. Docs: spec, README, AGENTS.md and DESIGN.md describe the
runner and its channel.
Fake daemons serve v10 open instead of the removed spawn op, hellos and welcomes use LINK_PROTOCOL_VERSION, and the removed ready capability is gone from expectations. Tests of below-v10 join blocks are deleted (such a host is refused at link time); session-resume asserts that v10 hosts own their runs. clusterJoinBlock drops its dead protocol parameter.
…ne redial test On a slow socket (Windows' small loopback buffers) the resend outlasted the test's ack hold: the released acks cover the lines main got before the drop, so the daemon rightly skipped the rest of the resend and the test waited for lines that would never come again. Hold acks until a full window is resent.
…e it listens omp children spawned during the pending listen() (restored sessions at startup) inherited umask 0177, so every file and directory their tools created was 0600.
ompweb preflight starts the session omp as a new host session would (same resolver and spawn, --no-session, scratch cwd) and waits up to 30 s for its hello. The host updater and the web self-update worker run the candidate's preflight in the live environment before stopping anything and abort on failure. An npm ompweb host now resolves the runner from its own package.
…rver if the socket chmod fails
…ently and is found by a marker only it embeds
…d update disarms the launcher
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Collaborator
Author
|
Moved to #472: the head branch now lives on this repository. |
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.
Depends on #460: this branch sits on top of it, so until #460 merges the diff also shows #460's commits. Only the last commit (
feat(chat): restyle omp's ask dialogs and forms) belongs to this PR.Summary
With #460, omp's
askdialogs and forms arrive again asui_requestframes and are rendered from their arguments. This restyles them (components/ExtensionDialog.tsx,app/globals.css):outline: nonehid keyboard focus on text fields; the app's focus ring is back, around the whole row for "Other".:user-invalid), and text fields follow the touch-target setting.color-scheme: dark, so native controls there are dark. This affects every native control in that theme.Behaviour and wording are unchanged.
Verification
ExtensionDialog*.test.mjs(5 files, 49 tests) pass; two mobile-overflow assertions ([Bug] question tool layout #234) moved from inline styles to the CSS class and rule. Typecheck and eslint clean.