Commit Graph
599 Commits
Author SHA1 Message Date
Federico Jaramillo Martinez cc8f379143 fix(auth): invalidate stale browser OAuth operations 2026-07-18 08:06:18 +02:00
Federico Jaramillo Martinez 3c3741b565 fix(auth): reconcile committed OAuth cancellation 2026-07-18 07:48:27 +02:00
Federico Jaramillo Martinez aca168a311 fix(runtime): align supported requirements and release hygiene 2026-07-18 00:10:47 +02:00
Federico Jaramillo Martinez 1f13bab58a fix(realtime): isolate notification failures 2026-07-17 23:58:56 +02:00
Federico Jaramillo Martinez 45f068ef05 fix(runtime): reload model config at service boundaries 2026-07-17 23:48:32 +02:00
Federico Jaramillo Martinez 3a208e648e fix(auth): preserve OAuth interaction semantics 2026-07-17 23:34:58 +02:00
Federico Jaramillo Martinez a39cf49f3a fix(auth): prevent API key reuse across login prompts 2026-07-17 23:18:58 +02:00
Federico Jaramillo Martinez 68d8bd1788 test: stabilize fileTreeService truncation test on slow filesystems 2026-07-17 23:03:13 +02:00
Federico Jaramillo Martinez 910c6b5ae0 refactor: derive auth-provider login options from SDK data instead of hardcoded provider lists 2026-07-17 22:57:33 +02:00
Federico Jaramillo Martinez 50defbae58 refactor(test): remove unused template-inspection helpers
Remove the three shared template-inspection test helpers that had no
consumer after the Slice B migrations: templateStaticMarkup,
collectTemplateStrings, and collectStringValues. They were kept alive
only by a temporary @public knip shim; with no in-window test needing
them, the finish-line requirement forbids dead helpers, so remove them
outright. knip is now satisfied without the shim.
2026-07-17 22:17:09 +02:00
Federico Jaramillo Martinez 28f328f475 refactor(test): use deterministic waits instead of sleeps in spawnSubsession test 2026-07-17 22:10:25 +02:00
Federico Jaramillo Martinez d0cc55cce3 Migrate test doubles + testSupport to ModelRuntime/InMemoryCredentialStore (slice 5)
Replace AuthStorage.inMemory / ModelRegistry.create|inMemory across all test
and support code with the pi-ai InMemoryCredentialStore + async
ModelRuntime.create({ credentials }). Add shared test-runtime seams
(createTestModelRuntime, testModelRuntime, seedCredential) in testSupport.ts
and thread modelRuntime into fakeRuntime and every PiSessionService
construction (now a required dependency). Rework the anthropic subscription
warning tests onto a temp auth.json seam read via readStoredCredential, and
the auth-loss warning test onto a live credential store + runtime refresh.
Make getLoginProviderOptions synchronous and fix associated await/lint sites.

npm run verify green (typecheck + lint + knip + 1390 tests).
2026-07-17 21:56:53 +02:00
Federico Jaramillo Martinez 0c04c9b19c refactor(test): use vi.waitFor instead of sleeps in promptQueue test 2026-07-17 21:54:29 +02:00
Federico Jaramillo Martinez 2d7ff629be refactor(test): migrate promptAttachmentCapture.test.ts to shared template-inspection seam 2026-07-17 21:47:28 +02:00
Federico Jaramillo Martinez 9a94f41a61 refactor(test): migrate ChatView.test.ts to shared template-inspection seam
Reclassify ChatView.test.ts per the testing-guide skill: move content/text/
attribute/ordering assertions to new pure public seams on ChatView.ts
(chatSessionWarningRows, chatQueuedSectionShowsClearAction, chatGroupAnchorKey,
chatEventAnchorKey, chatGroupScrollMarkerId, chatMessageGroupClassName,
chatMessageGroupLabel) with the component render code delegating to them, and
route the genuine Clear-queue/dismiss/toggle event wiring through the shared
templateInspection.testSupport helpers with escape-hatch comments. Delete the
per-file TemplateResult-inspection cluster. Drop the now-consumed @public tag
from templateEventHandlerNearMarker.
2026-07-17 21:37:30 +02:00
Federico Jaramillo Martinez 4ccd4f81fc Migrate piSessionService to ModelRuntime (slice 4)
Pass modelRuntime to createAgentSessionServices instead of authStorage +
modelRegistry; carry ModelRuntime on PiAgentSession; make modelRuntime a
required PiSessionService dependency (sessiond already injects auth.runtime).
Switch anthropicSubscriptionWarning to readStoredCredential, and rederive
model reads (availableModels/setModel/syncCurrentModelAuthWarning) via the
runtime (getAvailableSnapshot/getModel/hasConfiguredAuth). sessiond.ts and
piSessionService.ts now typecheck; only slice-5 test/support files remain.
2026-07-17 21:32:02 +02:00
Federico Jaramillo Martinez 6ba215503f refactor(test): migrate ChatView image test to shared inspection seam
Replace the per-file TemplateResult inspection helper cluster in
ChatView.image.test.ts with the shared templateInspection.testSupport
escape hatch for genuine event wiring (@load re-pin, @click zoom), and
move content/attribute assertions to new pure public seams on ChatView
(chatImagePartSource, chatToolOutputLabel, chatMessageAnchorKey) that
the component's own render code now delegates to.
2026-07-17 21:15:35 +02:00
Federico Jaramillo Martinez 1c3d6db109 Migrate oauthLoginFlowService to pi-ai AuthInteraction contract
Reimplement OAuthLoginFlowService against the pi-ai AuthInteraction
({ signal?, prompt(AuthPrompt), notify(AuthEvent) }) contract instead of
the removed OAuthLoginCallbacks shape, and drive login via
runtime.login(providerId, "oauth", interaction). start() now takes a
ModelRuntime instead of authStorage, resolving the authService.ts line-83
error. AuthPrompt text/secret/manual_code/select map onto the existing
web-UI prompt/select flow state; auth_url/device_code map onto the auth
field; info/progress append to progress. Per-prompt AuthPrompt.signal now
cancels just that pending request without ending the flow.

Slice 3 of the issue-62 authStorage migration relay.
2026-07-17 21:09:39 +02:00
Federico Jaramillo Martinez d02bbfa545 refactor(test): migrate WorkspaceFilesPanel test to shared template-inspection seam
Route genuine Lit event-wiring (upload input change, form submit, file-tree
row clicks) through the shared templateInspection.testSupport escape hatch and
add the required proportionality comment. Move viewer content messaging
(empty/loading/binary states) to a new public workspaceFileViewerStatusLabel
seam on the component instead of scraping Lit markup for text. Delete the
per-file inspection helper cluster; drop @public from the two shared helpers
that now have a real importer.
2026-07-17 21:06:12 +02:00
Federico Jaramillo Martinez d09d7cc1ff Migrate authProviderOptions to ModelRuntime API
Rederive login/logout provider options from runtime.getProviders() +
listCredentials() + getProviderAuthStatus() instead of the removed
authStorage.getOAuthProviders()/list()/get() + getAll()/
getProviderDisplayName() surface (Pi 0.80.8+).

- Replace the AuthProviderModelRegistry structural interface with a
  runtime-shaped AuthProviderRuntime (getProviders/listCredentials/
  getProviderAuthStatus); a real ModelRuntime satisfies it.
- Make getLoginProviderOptions/getLogoutProviderOptions async to match
  the await call sites already in authService.ts.
- OAuth-capable providers = auth.oauth present; api-key providers =
  auth.apiKey present, preserving OAUTH_ONLY_PROVIDERS /
  isApiKeyLoginProvider logic. Display names from Provider.name.
- Update the test double to the new runtime shape.

Slice 2 of the authStorage migration relay. tsc: 31 -> 28 errors
(remaining are cross-slice: slices 3/4/5).
2026-07-17 20:58:46 +02:00
Federico Jaramillo Martinez e37148c193 Migrate authService to async ModelRuntime API (slice 1)
Move AuthService off the removed AuthStorage / ModelRegistry.create surface
onto the async ModelRuntime API:

- AuthService.create({ agentDir | runtime }) async factory wrapping
  ModelRuntime.create({ authPath, modelsPath }); createModelRuntimeForAgentDir
  replaces createModelRegistryForAgentDir.
- saveApiKey -> runtime.login(providerId, "api_key", nonInteractive) so the
  key is persisted through the runtime credential store.
- logoutProvider -> runtime.logout; refreshAuthState -> await runtime.refresh().
- startOAuthLogin now passes the runtime into OAuthLoginFlowService.start.
- authProviders/requireOAuthLoginProvider became async around getLogin/Logout
  provider options.
- sessiond.ts: async createRuntime, AuthService.create, pass modelRuntime to
  PiSessionService; sessionDaemonStartup awaits createRuntime.

Cross-slice: authProviderOptions (2), oauthLoginFlowService (3), and
piSessionService (4) still expose the old ModelRegistry shape, so the tree does
not fully typecheck yet. Session-daemon path changed -> manual sessiond restart
needed once the migration lands.
2026-07-17 20:53:42 +02:00
Federico Jaramillo Martinez e7926e173b refactor(test): route SettingsDialog panel test through a public seam
Replace the SettingsDialog.general.test.ts markup-scraping assertion (which
scraped the rendered TemplateResult for '<settings-general-panel', 'scope-note',
'This tab edits:') with an exported pure routing seam activeSettingsPanelTag()
and assert the section->panel contract directly. Delete the now-unused
collectTemplateStrings helper and its private template-reflection cluster from
SettingsDialog.testSupport.ts.

The .packages/.plugins/.sessiond siblings inspect no TemplateResult internals
(orchestration reflection only), so no migration was needed for them.
2026-07-17 20:48:17 +02:00
Federico Jaramillo Martinez 946f7612ae refactor(test): move SettingsSessiondPanel assertions to a public seam
Migrate the prime Finding-2 offender off Lit TemplateResult scraping. The
panel's dynamic notice-stack logic is extracted into an exported pure
sessiondPanelNotices() (plus SessiondPanelNoticeContext) and the existing
sessiondDescription is exported, so the test asserts notice
composition/ordering and the scope description through public seams instead of
flattening rendered template internals. Save and draft-preservation behavior
are observed via the injected onSave callback and public state.

Removes all per-file template-inspection helpers and the escape-hatch need for
this file (testing-guide Findings 1-3).
2026-07-17 20:41:49 +02:00
Federico Jaramillo Martinez 55bc567b7b refactor(test): add shared template-inspection test helper (Slice A)
Consolidate the duplicated, per-file Lit TemplateResult inspection helper
cluster into one shared, strictly-typed, type-guarded seam at
src/client/src/templateInspection.testSupport.ts, documented as the
testing-guide escape hatch. Migrate PiWebApp.clearQueue.test.ts to it as a
proof and delete its local copies. Tag not-yet-consumed public entry points
with @public so knip does not flag them until Slice B adds consumers.

Relay: testing-skill-compliance leg 1 (Finding 1).
2026-07-17 20:23:21 +02:00
Federico Jaramillo Martinez aedcbf885e feat(sessions): surface live session startup warnings in the web UI
Show a pinned banner at the top of the session view with resource and
runtime diagnostics (skills, prompts, themes, extension load errors) plus
the Anthropic subscription-auth billing notice, recomputed live from the
current runtime so they stay accurate across browser reloads.

Warnings carry an optional dismiss capability; the Anthropic notice is
dismissable and durably suppressed through pi's own anthropicExtraUsage
warning setting. Also fixes the testing-guide skill frontmatter so it
loads.
2026-07-17 19:16:58 +02:00
Federico Jaramillo Martinez 2b17145291 feat(sessions): stream in-flight partial when joining a mid-turn session
Seed the in-flight partial assistant message (text, thinking, and
in-progress tool calls) when opening or reconnecting to a session that is
mid-stream, then continue streaming live deltas on top of it. Replaces the
blocking "Catching up..." placeholder and the end-of-turn transcript reload.

Server stamps every per-session UI event with a monotonic seq at the
SessionEventHub publish choke point and exposes
GET /sessions/:sessionId/stream-snapshot returning { seq, partial }. The
client fetches the snapshot on join, seeds the normalized partial into the
in-memory transcript (never the history cache), and applies buffered/live
events using the seq watermark for exactly-once delivery.

The snapshot is a progressive enhancement: a 404 from an older remote
pi-web or a not-yet-restarted session daemon falls back to an empty seed
(seq 0, drops nothing), so sessions still open and stream normally. The
stream-snapshot route is registered in the federation allowlist for
remote-machine proxying.
2026-07-17 14:49:56 +02:00
Federico Jaramillo Martinez ae9eaf3082 Match image zoom close button to app button styling 2026-07-17 11:15:05 +02:00
Federico Jaramillo Martinez 6cd666f9b8 Add click-to-enlarge modal viewer for chat images 2026-07-17 09:52:54 +02:00
Federico Jaramillo Martinez 15d25d8c2e fix(subsessions): omit oversized completion output 2026-07-17 09:22:54 +02:00
Federico Jaramillo Martinez a857fe4ef3 Merge pull request #58 from ongspxm/feat_addtermflag
feat(terminals): set PI WEB shell environment
2026-07-14 23:58:52 +02:00
Federico Jaramillo Martinez 8da7b29ba6 fix(terminals): namespace terminal environment marker 2026-07-14 23:56:24 +02:00
Federico Jaramillo Martinez 1c22558105 test(terminals): cover IS_PIWEB spawn paths 2026-07-14 23:48:30 +02:00
Federico Jaramillo Martinez cc4443ea55 Merge pull request #60 from jmfederico/fix/pr-53-live-tool-result-images
fix: show live tool result images outside event groups
2026-07-14 23:36:54 +02:00
Federico Jaramillo Martinez 58aa9b8955 fix: use standard chat styling for tool images 2026-07-14 23:28:06 +02:00
Federico Jaramillo Martinez 5fa52a9fba fix: present tool images as labeled output 2026-07-14 22:55:07 +02:00
ongspxm 73ac24c882 feat(terminals): set PI WEB shell environment 2026-07-14 21:21:50 +08:00
Federico Jaramillo Martinez b8c12caa9e test: isolate chat image rendering coverage 2026-07-14 09:02:46 +02:00
Federico Jaramillo Martinez c22a2feff6 fix: keep late-loading chat images pinned 2026-07-14 08:58:00 +02:00
Federico Jaramillo Martinez 5ce76a12e2 fix: show live tool result images 2026-07-14 08:48:48 +02:00
Federico Jaramillo Martinez ca07e48c0a docs: clarify Pi-compatible agent profiles 2026-07-14 00:30:09 +02:00
Federico Jaramillo Martinez a1f749cdb6 feat: add server session queue clearing 2026-07-14 00:24:14 +02:00
Federico Jaramillo Martinez 8b5ccc2fd9 feat: apply agent profile settings atomically 2026-07-14 00:11:39 +02:00
Federico Jaramillo Martinez c0465c4a5c fix: delimit subsession output from guidance 2026-07-14 00:04:53 +02:00
Federico Jaramillo Martinez 0761e1509a fix: report remaining subsessions on completion 2026-07-13 23:41:20 +02:00
Federico Jaramillo Martinez adc2e297a4 fix: harden agent profile boundaries 2026-07-13 23:39:49 +02:00
Federico Jaramillo Martinez 97e0afc6fa feat: route profile consumers through sessiond 2026-07-13 23:09:32 +02:00
Federico Jaramillo Martinez 141cda93c8 feat: expose daemon-owned active agent profile 2026-07-13 22:50:50 +02:00
Federico Jaramillo Martinez d5154dfb3a feat: add explicit tracked subsession yielding 2026-07-13 22:45:07 +02:00
Federico Jaramillo Martinez a1a019e7b1 chore: merge origin/main 2026-07-13 22:36:36 +02:00
Federico Jaramillo Martinez 37fba00066 Merge pull request #50 from jmfederico/review-issue-48
fix: store session archives under PI_WEB_DATA_DIR
2026-07-13 21:11:50 +02:00