Skip to content

fix(plan): preserve the owning session permission on approval - #2326

Merged
vastsa merged 6 commits into
vastsa:mainfrom
Linuxdazhao:codex/plan-approval-permission-20261113
Nov 14, 2026
Merged

vastsa merged 6 commits into
vastsa:mainfrom
Linuxdazhao:codex/plan-approval-permission-20261113

Conversation

@Linuxdazhao

@Linuxdazhao Linuxdazhao commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Plan approval currently takes its default execution permission from device-wide
approval history. An Auto Session can therefore return to Agent in Ask after
the main approval click; an Ask Session can also receive another Session's
remembered Auto choice.

Initialize the card from the proposal's owning Session, resolving inherit
through the global default and finally Ask. Ignore the old localStorage
preference. Explicit menu choices still select execution permission; Host
approval identity checks and persistence remain unchanged. Update the affected
specs, ADR and E2E-106 scenario.

The original commits are preserved. Candidate 0dc6a160e59e contains main
32a1386e294c, including the Windows snapping and explicit-zero cache fixes.
The ADR index conflict retains both decisions.

Validation on this candidate (macOS arm64, Node 26.13.1, Electron 43.6.0,
lockfile-pinned Pi 1.5.0, reused compatible development dependencies):

  • Replaying the real component and helper from current main fails both
    policy-direction regressions (ask !== auto and auto !== ask). All 37
    targeted Plan/component/history/probe tests pass on the candidate.
  • Candidate workspace package builds, full Desktop TypeScript and production
    Desktop build pass. A fresh candidate Host build passes. Documentation
    pair/page, architecture, style-token, agent-policy, base and whitespace
    checks pass. Biome's configured include list excludes the touched files;
    the zero-file invocation is not claimed as a lint pass.
  • node scripts/e2e-plan-ui.mjs --permissions-only: all eight native cases
    pass. They cover explicit Ask/Accept edits/Auto, all three inherited global
    modes, stale device history, explicit Auto-to-Ask approval, rejection, and
    durable permission after renderer reload. The production card, preload,
    Main and real Rust Host execute; only proposal seeding uses the existing
    Main-only environment-gated probe. Probe call IDs are Session-scoped so
    independent synthetic Sessions can share the isolated database.
  • Full node scripts/e2e-plan-ui.mjs: 6/6 required cases pass, zero console
    diagnostics. EN/zh-CN, responsive sizes, artifact persistence, rejection,
    resubmission, approval, reload and the permission matrix pass. A background
    run timed out waiting for menu measurement; keeping only the isolated test
    window foreground made the unchanged assertions pass. No product logic or
    assertion was relaxed.
  • node scripts/e2e-plan.mjs: 14 passed, 0 failed, 4 skipped. The skipped
    legs require clock control, another available shell, making an installed
    shell unavailable, or the opt-in 60-second timeout run.

All native state, HOME and profiles are isolated and synthetic. No live
provider is configured: approval persistence is real, while automatic
execution reports the expected missing-provider outcome. The optional live
provider case, installed-client upgrade and Windows/Linux native UI were not
run. Previously changed Sessions are not silently restored. Vercel deployment
authorization remains separate from code validation.

Fixes #2325

Default approval to the owning session effective permission instead of a device-wide remembered choice. Otherwise ordinary approval can replace Auto with Ask, or offer Auto to an Ask session.

Keep explicit approval choices and host enforcement unchanged.

fixes vastsa#2325
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@Linuxdazhao is attempting to deploy a commit to the vastsa's projects Team on Vercel.

A member of the Team first needs to authorize it.

Use the required ADR heading and a separate Consequences section so the documentation catalog can validate the permission decision.
Preserve the published permission fix and the Windows snapping decision when combining the request with the latest upstream baseline.
Exercise explicit and inherited session permissions through the real approval card, preload and Host, including stale device history, explicit override, rejection and reload. Scope probe call identities to each synthetic session so the native matrix can share an isolated database.
Retain the published permission fix while qualifying it with the latest upstream runtime changes.
@Linuxdazhao
Linuxdazhao marked this pull request as ready for review November 14, 2026 10:57
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

Refreshed this existing PR without rewriting its published commits. Head
0dc6a160e59e contains main 32a1386e294c. The ADR index retains both the
Windows snapping decision and this Session-permission amendment.

The missing native qualification is now complete on macOS arm64 / Node
26.13.1 / Electron 43.6.0:

  • 37 targeted Plan/component/history/probe tests pass. Replaying current
    main's real component/helper still fails both default-permission regressions.
  • Full Desktop TypeScript and production build, candidate workspace package
    builds, a fresh Host build, docs, architecture, style-token, policy, base
    and whitespace checks pass. The configured Biome include list excludes the
    touched files, so no touched-file Biome pass is claimed.
  • Native e2e-plan-ui.mjs --permissions-only passes all eight cases: explicit
    and inherited modes, stale device history, explicit Auto-to-Ask approval,
    rejection, and durable permissions after reload. Full Plan UI passes 6/6
    required cases with zero console diagnostics. The real production approval
    card/preload/Main/Host path runs; the existing gated Main probe only seeds
    proposals. Session-scoped probe IDs avoid cross-Session fixture collisions.
  • Headless Plan acceptance passes 14 cases, with four documented environment
    or opt-in long-duration legs skipped. The optional live-provider UI case is
    skipped. No real provider or user profile is used.
  • The first background-window full UI run timed out waiting for menu
    measurement; keeping only the isolated test window foreground passes all
    unchanged assertions. No product workaround or assertion relaxation.

All six current-head Actions checks passed:
https://github.com/vastsa/PI-Desktop/actions/runs/43587714582

Fetched integration 05177011125f and the tested head have the same complete
tree 140df99611f77ed29053772295a09f5e3c55f697. The PR is now Ready for
maintainer review. Vercel separately requires team deployment authorization.
Installed-client upgrades, live-provider execution and Windows/Linux native
UI remain unqualified; no merge is claimed.

@vastsa vastsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independently reproduced both default-permission regressions by replaying current main production component/helper: Auto becomes Ask and stale remembered Auto overrides Ask. The candidate fixes the default at its owning Renderer component without changing Host approval identity, atomic persistence, or explicit menu semantics.

Validated integrated head 262c9f8 against main f3cb2a3: locked Host build, workspace dependency builds, Desktop production build/typecheck, 14 targeted tests, native Electron permission matrix (8 cases), complete Plan UI acceptance (6 required cases, zero console diagnostics), and real Host Plan acceptance (14 passed, 4 explicitly skipped). Isolated synthetic state; no live provider, installed-client upgrade, or native Windows/Linux UI qualification claimed. Electron 43.6.0 was provisioned from the existing compatible local installation after initial missing-binary startup failure.

Actual fetched PR merge-ref tree matches tested head: 6d90b15bb79d654707a5c47783b1ebe320376fbf. Non-destructive GitHub branch update incorporated latest main; no product edits or contributor commits rewritten. Vercel preview authorization remains an unrelated external deployment restriction.

@vastsa
vastsa merged commit 22a55cf into vastsa:main Nov 14, 2026
6 of 7 checks passed
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.

[Bug] Plan approval replaces the session permission with a device-wide default

2 participants