Skip to content

fix(lan-webui): enforce the ask ceiling and archived-project read-only - #2644

Merged
vastsa merged 1 commit into
mainfrom
fix/lan-permission-archive
Nov 28, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/lan-permission-archive

Conversation

@vastsa

@vastsa vastsa commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Why

LAN WebUI hardening (LAN-01, LAN-02):

  • Permission ceiling was not enforced. The Agent Host computed the remote ask ceiling for a paired phone, but host-core authorized tools from the stored session mode. An inherit session with an auto default did not even forward the value, so a phone turn could run tools without Desktop approval.
  • Archived projects stayed writable. Send admission checked only the session's own archive flag, so the phone still offered Send/Queue in sessions of an archived project.

What

  • The ceiling is recorded on the durable turn and queue entry (schema v35, v34 backup). Every tool decision of that turn uses the stricter of the current session mode and the ceiling: delegates (which now keep their originating turn id), sessions created during the turn, session messages, and background continuations (refused) are all bounded. A Host that cannot record the ceiling starts no turn (PERMISSION_CEILING_UNAVAILABLE); the draft is kept.
  • Conversations of an archived project are read-only on the phone, naming the project to restore. Admission rechecks the current archive state (stale tabs included). A web archive refuses while a send is still being admitted, as well as while work is running, queued or waiting.
  • ADR turn-permission-ceiling; LAN WebUI, storage, security, rollout and E2E-270/272 specs updated.

Behavior note: queue entries persisted before v35 use their admitted mode as their ceiling.

Validation (task candidate 5ad6880f7, base f92b18430)

  • cargo test -p host-core: 1379 passed; 3 failures that also fail on unmodified main locally (macOS temp-path aliasing, plugin timestamp). cargo fmt --check clean; clippy shows only two existing warnings in untouched files.
  • vitest: agent-host, host-runtime, agent-runtime (2182), racp, pi-host all pass; shared racp tests pass.
  • desktop node --test: new bridge and LAN archive/ceiling tests pass and fail on the old code; remaining failures also fail on unmodified main locally or need a renderer build.
  • test:e2e:lan-webui (Electron): 7/7, including a new archived-project journey.
  • Biome, architecture check, docs checks pass.

A paired phone's turn computed the remote `ask` ceiling but never applied
it: host-core authorized tools from the stored session mode, and an
`inherit` session with an `auto` default did not even forward the value.
Phone turns could therefore run tools without Desktop approval. The
ceiling is now recorded on the durable turn and queue entry (schema v35)
and host-core applies the stricter of it and the current session mode to
every tool decision of that turn, including delegates, child sessions,
session messages and background continuations. A Host that cannot record
it starts no turn.

The phone also offered Send and Queue in sessions of an archived project,
because send admission checked only the session's own flag. Those
conversations are now read-only with a project restore action, admission
rechecks the current archive state, and a web archive refuses while a
send is still being admitted.

Records ADR turn-permission-ceiling and updates the LAN WebUI, storage,
security and E2E specs.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5ad6880
Status: ✅  Deploy successful!
Preview URL: https://a72d1c93.pi-desktop.pages.dev
Branch Preview URL: https://fix-lan-permission-archive.pi-desktop.pages.dev

View logs

@vastsa
vastsa merged commit 44b06ef into main Nov 28, 2026
7 checks passed
@vastsa
vastsa deleted the fix/lan-permission-archive branch November 28, 2026 15:07
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