Compare commits

...

5 Commits

Author SHA1 Message Date
Michal
3fa41e4d46 Merge main into feat/pi-extension
Some checks failed
CI/CD / typecheck (pull_request) Successful in 1m11s
CI/CD / lint (pull_request) Successful in 2m28s
CI/CD / test (pull_request) Successful in 1m24s
CI/CD / smoke (pull_request) Failing after 1m55s
CI/CD / build (pull_request) Successful in 4m45s
CI/CD / publish (pull_request) Has been skipped
2026-08-08 19:59:25 +01:00
Michal
79e04ed89f Merge 'refactor(prime-agent): tray status only' into main
Some checks failed
CI/CD / typecheck (push) Successful in 1m4s
CI/CD / lint (push) Successful in 2m6s
CI/CD / test (push) Successful in 1m34s
CI/CD / build (push) Successful in 2m19s
CI/CD / smoke (push) Failing after 3m13s
CI/CD / publish (push) Has been skipped
2026-08-08 19:59:25 +01:00
Michal
90c49bcb22 refactor(prime-agent): drop the widget fallback, keep the tray status
With prime-agent-extension-status.patch in place the tray renders
ctx.ui.setStatus() next to the model name, which is what a status line should
be. The widget was a workaround for its absence and was never a substitute:
widgetContainerBelow sits in the fullscreen *scroll* list, not the dock, so it
scrolled away with the transcript, and with both set the project name appeared
twice.

The startup retries stay: resetExtensionUI() clears extension statuses just as
it cleared widgets, so the value set during session_start is still wiped before
it can be seen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BMXdb2qZbPSh8Q7XpTyjB
2026-08-08 19:59:24 +01:00
Michal
cee27084ac Merge 'fix(prime-agent): indicator re-publish after widget reset' into main
Some checks failed
CI/CD / typecheck (push) Successful in 1m4s
CI/CD / lint (push) Successful in 2m7s
CI/CD / test (push) Successful in 1m20s
CI/CD / build (push) Successful in 2m18s
CI/CD / smoke (push) Failing after 2m44s
CI/CD / publish (push) Has been skipped
2026-08-08 19:52:08 +01:00
Michal
0a29c2fd7f fix(prime-agent): re-publish the indicator after prime-agent clears extension widgets
Verified with a probe extension rather than by reading the bundle: session_start
fires with hasUI=true, ctx.ui.setWidget exists and the call returns without
throwing — and the widget still never appeared.

Cause is prime-agent wiping it immediately afterwards. resetExtensionUI() ->
clearExtensionWidgets() runs from onBeforeSessionInvalidate and from the
connection-state-snapshot handler, both of which land after session_start, so
the indicator was set and cleared before it could be seen. Nothing re-set it
until a turn, which is why a fresh session with no messages showed nothing.

Re-publishes at 1s/3s/6s after session_start to land past that reset.
setWidget is idempotent, so a redundant retry costs one re-render.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BMXdb2qZbPSh8Q7XpTyjB
2026-08-08 19:52:07 +01:00
2 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -537,12 +537,12 @@ describe('config prime-agent', () => {
await cmd.parseAsync(['prime-agent', '--project', 'ha', '-o', settingsPath, '--skip-skills', '--token', 'mcpctl_pat_x'], { from: 'user' });
const ext = readFileSync(join(tmpDir, 'extensions', 'mcpctl-switch.ts'), 'utf-8');
// prime-agent stores extension statuses but never renders them, so a
// setStatus-only indicator is invisible there. Widgets are rendered.
expect(ext).toContain('ctx.ui.setWidget(STATUS_KEY');
expect(ext).toContain("placement: 'belowEditor'");
// Still set the status: pi's footer does render it.
// Both hosts render statuses next to the model name (pi in its footer,
// prime-agent in the tray — the latter via prime-agent-extension-status.patch).
expect(ext).toContain('ctx.ui.setStatus(STATUS_KEY');
// The widget was a workaround for the unpatched tray; it scrolled away with
// the transcript, so it is not a status line and must not come back.
expect(ext).not.toContain('setWidget');
// prime-agent emits session_start only from reload(), never at startup, so
// a session_start-only indicator stays blank until the first switch.
expect(ext).toContain("pi.on('turn_start'");