Repository navigation
Desktop interface, stored credentials, streaming, and cancellation (Phases E, D2-D5) - #33
James-Chapman wants to merge 10 commits into
Conversation
Version 0.29.0 adds a prototype Tauri desktop shell with a session tree, full-text search, chat, and an isolated approvals window. The trusted CLI is unchanged in behaviour. See ADR-0044, ADR-0045, and ADR-0046. - core: inspect a journal without the writer lock, discover journals within bounds, and index them in a rebuildable SQLite FTS5 store - core: review an approval by reproducing its digest with the tool dispatcher's own request builder, and render display-safe fields - omgcode-app: move the chat turn out of the CLI binary into a shared library and add the desktop service layer; no CLI test file changed - omgcode-desktop: an 18-command Tauri 2 shell. Only the approvals window can decide an approval, enforced by capability files and by a Rust check that every handler runs first - frontend: strict TypeScript that renders text nodes only, with Vite, Vitest, and Biome - ci: build the frontend before Cargo and add a Frontend workflow - docs: a desktop interface guide, three ADRs, and corrected guides Verified on Windows 11 and on Linux under WSL 6.6: formatting, Clippy, all-target tests, and doc tests pass on both. The real shell was driven end to end on Windows only. No window has been opened on Linux, and the workflow changes have not run on GitHub. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Version 0.30.0 lets the operator select a provider profile so that the local LM Studio adapter reads its server token from protected OS storage instead of the OMGCODE_LM_TOKEN environment variable. See ADR-0047. - core: provider_credential_binding decides whether a credential may be used without taking a credential store, so it cannot touch native storage. It refuses an unknown profile, a profile of another provider kind, a subscription profile, and an unbound api_key profile. load_provider_credential then refuses a binding from another backend before it reads a secret - omgcode-app: TokenSource and resolve_lm_token. A selected profile is the only source, the environment variable is not read, and any failure ends the turn with a credential error. The token is held in a zeroing buffer for one turn - cli: --provider-profile on chat and session compact, and stored_credential_adapters in capabilities - desktop: --provider-profile at launch, checked once before any window opens and resolved again for each turn. The wire contract is unchanged - docs: ADR-0047, the authentication and desktop guides, the changelog, and the plan. The plan's Phase E entries no longer say the shell has no Linux build Without the flag, behaviour is unchanged. The credential is bound to a provider kind, not to an endpoint. No cloud adapter or login exists. Verified on Windows 11 with DPAPI and on Linux under WSL 6.6 with the Secret Service: formatting, Clippy, all-target tests, and doc tests pass on both. A stored-credential turn was not driven through the real shell's windows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Version 0.31.0 lets an lm_studio provider profile record its endpoint, so a selected profile supplies both the endpoint and the token. A stored token can no longer be sent to an endpoint named on the command line. See ADR-0048, which amends ADR-0047. - core: a provider profile records an optional immutable endpoint. Only lm_studio accepts one; it is checked by the shared validate_base_url when recorded and again on replay, and is limited to 256 bytes. provider_credential_binding returns the endpoint with the binding and refuses a profile without one as endpoint_not_recorded. The journal field is written only when present, so a journal without an endpoint is unchanged - omgcode-app: ConnectionSource and resolve_local_connection replace resolve_lm_token. A selected profile is the only source of both values. The desktop service refuses a turn with endpoint_changed when the profile's endpoint no longer equals the launch value - cli: --endpoint on provider-profile-add. --endpoint and --provider-profile conflict on chat and session compact (exit 2). capabilities reports provider_profile_endpoints - desktop: --endpoint and --provider-profile conflict at launch, and the shell shows the profile's endpoint. A launch_flags suite runs the real binary. The wire contract is unchanged - docs: ADR-0048, the authentication, desktop, and workspace settings guides, the changelog, and the plan Without --provider-profile, behaviour is unchanged. A profile recorded before 0.31.0 has no endpoint and must be removed and added again. A control journal that records an endpoint cannot be read by 0.30.0. No endpoint rule exists for a non-loopback provider, and no cloud adapter or login exists. Verified on Windows 11 with DPAPI and on Linux under WSL 6.6 with the Secret Service: formatting, Clippy, all-target tests, and doc tests pass on both. A stored-credential turn was not driven through the real shell's windows, and CI has not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Version 0.32.0 lets the LM Studio adapter read a streamed reply and has the desktop shell push chat events to the main window, so the chat window shows text while the model generates and no longer polls every 750 ms for the end of a turn. See ADR-0049. - core: complete_streaming and complete_with_tools_streaming send the same request with stream set to true and read the reply as server-sent events under strict rules, within the existing 1 MiB and thirty-second bounds. A stream that ends without [DONE] is the new IncompleteStream error. Tool calls are assembled by index and hold only the members received, so the existing tool-call validation applies unchanged. DisplaySafeStream is a streaming form of the display-safe escaping. The non-streaming methods are unchanged and stay the default - omgcode-app: ChatHooks::on_stream delivers provisional text, and a turn streams only when it is set. StreamRedactor removes the server token across piece boundaries. The journal still records only the whole validated reply and does not say whether it was streamed. The desktop service gains an event hub with one subscriber, a bounded preview per running turn, and a guard that sends finished after the result is recorded - cli: chat --stream writes escaped provisional text to standard error; standard output still carries the one JSON result. capabilities reports streaming_adapters - desktop: chat_subscribe, main window only, takes a caller-created Tauri IPC channel, so neither window needs a core permission. The shell has 19 commands. --stream <on|off> at launch, default on - frontend: one subscription, a live entry for the open session rendered as text, one chat_status read on finished, a five-second reconcile check, and the 750 ms poll as a fallback. The command name stays out of the approvals bundle - docs: ADR-0049, the desktop, provider, development, testing, and session storage guides, the changelog, and the plan Streamed text is provisional: a later failure discards it. Cancellation still cannot interrupt a request in flight, and the thirty-second deadline still covers the whole response. No dependency is added, and sessions stay at schema version 3. Verified on Windows 11 and on Linux under WSL 6.6: formatting, Clippy, all-target tests, and doc tests pass on both. The frontend checks pass on Windows. The real Windows shell was driven end to end against a paced event-stream mock. No live LM Studio server was used, no window has been opened on Linux, and CI has not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Version 0.33.0 makes a cancel request stop a streamed model request. Before, cancellation was checked only between model rounds and tool calls, a text-only turn could not be cancelled at all, and the desktop shell abandoned a turn still waiting on the model when it exited. See ADR-0050. - core: complete_streaming and complete_with_tools_streaming take a CancelToken. The streamed request runs on an async client inside a single-thread runtime made for that one request, with the same settings and the same thirty-second total deadline as the blocking client. The token is checked every 25 ms before the request is sent, while the response head is awaited, and while each piece is awaited. A set token drops the request and returns the new ProviderError::Cancelled. The event-stream reader becomes a push parser, so the ADR-0049 rules hold for any chunking. ToolModelRequest carries the turn token, and the runtime ends a turn as cancelled when a model reports ModelError::Cancelled and the token is set - omgcode-app: a streamed text-only turn creates a cancel token and hands it to the front end. A cancelled turn is recorded with the existing failure reason cancelled, no assistant message, and no open turn, and is reported with the new error kind cancelled. The tool path used the general kind turn before - desktop: chat_cancel now stops a streamed request, and exit no longer abandons a streamed turn. No command, event, or wire type changes - frontend: a failed status with the code cancelled shows the plain notice Turn cancelled, decided by the code only - docs: ADR-0050, the desktop, provider, testing, and session storage guides, the changelog, and the plan Still not interruptible: a non-streamed request, the compaction request before a turn, and a tool call in progress. The CLI has no cancel source. No dependency or cargo feature is added, no journal record changes shape, and sessions stay at schema version 3. Verification ran on a host held at 82 to 100 percent CPU by an unrelated build. Linux under WSL 6.6: formatting, Clippy, all-target tests, and doc tests pass. Windows 11: formatting, Clippy, and doc tests pass; the all-target run has one failure, run_workflow::concurrent_runs_complete_and_are_recorded, a CPU-bound confined-runner test that reached its 60-second limit. It fails the same way on a clean checkout of the previous commit under the same load and uses none of the changed code. It was not rerun on a quiet host. The frontend checks pass on Windows, and the real Windows shell was driven end to end against a mock that holds a stream open. No live LM Studio server was used, no window has been opened on Linux, and CI has not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On Windows each run in concurrent_runs_complete_and_are_recorded spun a fixed loop of 30,000 "cd ." iterations before writing its file, and the test allowed 60 seconds for both. On a host held near 100 percent CPU by an unrelated build, one such loop took 22 to 24 seconds in a plain shell, and the test failed three times in a row, on the cancellation change and on the commit before it. Each run now writes its own file and waits until it sees the file of the other run. Exit code 0 from both proves the two runs were alive at the same time, which the old scripts did not: two runs made one after the other would also have passed. A run that never sees the other file exits non-zero. The Linux scripts use the same rendezvous in place of "sleep 1". The assertions and the 60-second limit are unchanged, and no production code changed. The testing guide gains the rule that a fixed amount of work is not a reliable delay. The changelog and the plan record the cause and the results. Verified on the same loaded host: formatting, Clippy, all-target tests, and doc tests pass on Windows 11 and on Linux under WSL 6.6, with no failures. Neither suite has run on a quiet host since. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 175 files, which is 75 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
The first Sonar analysis of pull request 33 failed its quality gate and raised six findings. This fixes the findings and the analysis scope. - Both workflows install the frontend dependencies with "npm ci --ignore-scripts". The ui .npmrc already set this; the flag makes it hold even if that file changes - Four lines of frontend source and tests held raw bidirectional control characters, inside the pattern and the test strings that deal with those characters. They are now written as \u escapes, which denote the same characters. A frontend test fails if a raw one is added to source, styles, pages, or tests - sonar-project.properties declares test code as test code: every tests directory, every tests.rs module, and every *.test.ts file. All 1,035 duplicated lines Sonar reported were in test files, and 1,421 of the 2,767 lines it counted as code to cover were the frontend tests themselves Not fixed: the gate condition on coverage of new code. Sonar counts the frontend TypeScript sources as code to cover and no coverage report is produced, so that condition is expected to fail again. Producing one needs a coverage provider, which is a new dependency and is left for a decision. The repository-checks guide now says this. Verified on Windows: the frontend type check, Biome, 160 tests, and the 5 bundle tests pass, and the desktop crate tests pass. The Sonar configuration cannot be run locally; the pull request analysis is its check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CodeQL flagged the assertion message in a_tampered_stored_path_is_never_returned as cleartext logging: some of the tampered paths are built from a session identifier, and the message printed the path. The identifier is a random value made for the test and is not a credential, but a test has no need to print it. The message now names the case by its position in the list. The assertion itself is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Sonar quality gate requires 80 percent coverage on new code. Sonar counts the frontend TypeScript sources as code to cover, and no report existed, so the condition stood at 0 percent. - ui: add @vitest/coverage-v8 5.1.0 as a development dependency, pinned to the Vitest version, and an "npm run coverage" script. It writes coverage/lcov.info with paths relative to the repository root. The provider is published with each Vitest release under the MIT licence, adds 12 packages to the lockfile, none with an install script, and is used by nothing in the built bundle - sonar.yml: a new job, Frontend coverage, installs the locked dependencies, runs the tests with coverage, and uploads the report. The analysis job waits for it and downloads the report. The tests run dependency code, so they run in a job that never references the Sonar credential - sonar-project.properties: point sonar.javascript.lcov.reportPaths at the report - docs: the repository-checks, development, and desktop guides, the frontend README, and the changelog Nothing is excluded from the measure, including the development mock. Locally it is 85.7 percent of lines and 76.0 percent of branches, about 82 percent by the combined measure Sonar uses. That margin is thin. Rust is still not measured for coverage. Verified on Windows: a clean "npm ci --ignore-scripts", the type check, Biome, 160 tests, the coverage run, and the 5 bundle tests pass, and npm audit reports no vulnerabilities. The workflow and the Sonar configuration cannot be run locally; the pull request analysis is their check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Both were found by the first CI and Sonar runs on pull request 33. - stored_credential::early_outcomes_need_no_native_store failed on the Windows runner. It assumed that a folder under the temp directory inherits an access list the credential store refuses. That holds on some machines and not on the runner, whose temp folder grants only the user, the system, and administrators, which the store trusts. The test now grants the built-in Users group read access itself, by its identifier, so the condition it needs holds on any host. The store was correct on both machines - security.test.ts held raw bidirectional control characters in the pattern that scans for them: it was meant to be written with escapes and was saved as the characters. The test did not notice, because a glob never matches the file that contains it. The pattern is now written with escapes, and the test reads its own source as well Verified on Windows. The credential test: the old version fails with the CI message under a temp folder holding only trusted principals, and the new version passes there and under the normal temp folder, 12 of 12 each time. The scan test: planting a raw character in the file makes it fail and name the file; the frontend type check, Biome, 160 tests, the coverage run, and the 5 bundle tests pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|



Summary
Adds the prototype desktop shell (Phase E) and five provider increments on top
of it: stored-credential use (D2), endpoint binding (D3), streamed replies with
pushed chat events (D4, E6), and mid-stream cancellation (D5). Versions 0.29.0
to 0.33.0, ADRs 0044 to 0050. It is a prototype and is not release-ready.
What changed
omgcode-desktop,with a session tree, full-text search over a derived SQLite index, a paged
transcript, chat, and an isolated approvals window. A new
omgcode-applibrary holds the chat turn and the front-end-neutral
DesktopService; theCLI is now a thin adapter over it. The webview has no authority: each
command needs a per-window capability and passes a Rust window policy first.
--provider-profilemakes the LM Studio adapterread its token from protected OS storage. Every failure ends the turn; there
is no fallback to no token or another token.
lm_studioprofile records one immutableloopback endpoint, so a stored token goes only to that endpoint.
--endpointand--provider-profileare mutually exclusive.strict event-stream rules. Streamed text is provisional; the journal still
records only the validated whole reply.
chat --streamon the CLI. Theshell pushes chat events to the main window through one caller-scoped IPC
channel (
chat_subscribe, 19 commands) and no longer polls every 750 ms.every 25 ms. A cancelled turn is recorded as
cancelledand leaves no openturn. Exit no longer abandons a streamed turn.
concurrent_runs_complete_and_are_recordedwaited on a fixedCPU loop. It now uses a file rendezvous, which also proves the two runs
overlapped.
rust.ymlgains the Tauri system packages and the frontend build;a new
frontend.ymlruns the type check, Biome, Vitest, and bundle checks.Why it changed
The plan called for a desktop interface with the Rust core as the only
authority, and for the provider path to stop depending on an environment
variable and a command-line endpoint. Streaming and cancellation close the two
gaps an operator meets first: no output until a turn ends, and no way to stop
one.
Tests
Local results on the final commit, on a host held at 82 to 100% CPU by an
unrelated build:
cargo fmt --check, Clippy--locked, all-target tests (943passed, 0 failed, 8 ignored), and doc tests pass.
ignored).
port against mock model servers, for the base flow, streaming, and
cancellation.
Not verified: these CI workflows have never run before this pull request; no
live LM Studio server was used for streaming or cancellation; no window has
been opened on Linux; neither suite ran on a quiet host after the last two
commits.
Updated
omgcode-clisuites moved to the thin adapter;cli_workflowgainsevent-stream fixtures.
omgcode-corelocal_providerandturn_runtimefor the stream rules, thecancel token, and the
cancelledoutcome.omgcode-appchat_turnanddesktop_chat: a cancelled turn now reportsthe code
cancelled(wasturn).run_workflow::concurrent_runs_complete_and_are_recorded: file rendezvous inplace of a timed loop; assertions unchanged.
New
the event-stream parser under arbitrary chunking, and cancellation before a
request, before the response head, and during the body.
omgcode-app:desktop_sessions,desktop_approvals,desktop_chat,desktop_events,desktop_wire,stored_credential,desktop_stored_credential, and stream redaction across piece boundaries.omgcode-desktop:layers(command names, capabilities, policy, andfrontend argument keys agree) and
launch_flags(the real binary).chat_runner,live_preview,client,main_window,approvals,security, anddistsuites.🤖 Generated with Claude Code