Skip to content

fix(agent-poll): forced looks and a failing query no longer launch PowerShell nonstop (core 0.41.1) - #238

Merged
Maxaubert merged 1 commit into
mainfrom
fix/agent-poll-throttle
Oct 16, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
fix/agent-poll-throttle

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

PR 1 of 3 from the performance review (owner, 2026-10-16: "do all"). Report: research\prism-terminal\2026-10-16-perf-review.md.

1. The worst finding: forced process queries with no limit (verified high)
Every title frame and every hook signal of an agent the poll had not reported called termAgentLook, and main ran a fresh PowerShell + CIM query for each. A Claude the poll can never see (under WSL or SSH: its process is not in the Windows tree) therefore kept PowerShell queries running back to back while it worked, an estimated half to a whole core.

  • Renderer: askLook asks at most once in 15 s per tab (forgotten on close).
  • Main: a forced look within 5 s of the last query is an ordinary one (AGENT_FORCE_GAP).

2. A failing query never backed off (verified medium)
On a machine where the query always fails (WMI broken, AppLocker, Constrained Language) PowerShell ran every 2.5 s for the app's life. Failures now back off 5, 10, 20, 40 s, then a minute (AGENT_FAIL_MAX), forced looks included; the third failure in a row writes agent-poll-failing to the diagnostics log. An answer resets it.

3. Pointer moves re-rendered App twice a second (verified low)
Over the unfocused window, only when the tab in front has a Finished or Failed mark to take down.

Tests: 2 new poll tests (the failure backoff sequence and its reset; the forced-look gap), 2 updated for the gap. Unit 2184 pass. e2e indicator, agentHooks (43), indicatorStyles, launchSkeleton, imagePaste: all pass.

Core 0.41.0 -> 0.41.1, app 0.55.0 -> 0.55.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

…werShell nonstop (core 0.41.1)

Perf review 2026-10-16 (research\prism-terminal\2026-10-16-perf-review.md),
the worst finding and two small ones:

- Every title frame and hook signal of an agent the poll had not reported
  forced a PowerShell + CIM query. A Claude the poll can never see (under WSL
  or SSH) therefore kept queries running back to back while it worked, half
  to a whole core. The page now asks at most once in 15 s per tab, and main
  holds forced looks 5 s apart (AGENT_FORCE_GAP).
- A query that always fails (WMI broken, AppLocker, Constrained Language)
  launched PowerShell every 2.5 s for the app's life. Failures now back off,
  doubling from 5 s to a minute (AGENT_FAIL_MAX), forced looks included, and
  the third in a row writes `agent-poll-failing` to the diagnostics log.
- A pointer moving over the unfocused window re-rendered App twice a second;
  it now does only when the tab in front has a Finished or Failed mark to
  take down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA
@Maxaubert
Maxaubert merged commit a735745 into main Oct 16, 2026
2 checks passed
@Maxaubert
Maxaubert deleted the fix/agent-poll-throttle branch October 16, 2026 05:33
github-actions Bot pushed a commit that referenced this pull request Oct 16, 2026
…werShell nonstop (core 0.41.1) (#238)

Perf review 2026-10-16 (research\prism-terminal\2026-10-16-perf-review.md),
the worst finding and two small ones:

- Every title frame and hook signal of an agent the poll had not reported
  forced a PowerShell + CIM query. A Claude the poll can never see (under WSL
  or SSH) therefore kept queries running back to back while it worked, half
  to a whole core. The page now asks at most once in 15 s per tab, and main
  holds forced looks 5 s apart (AGENT_FORCE_GAP).
- A query that always fails (WMI broken, AppLocker, Constrained Language)
  launched PowerShell every 2.5 s for the app's life. Failures now back off,
  doubling from 5 s to a minute (AGENT_FAIL_MAX), forced looks included, and
  the third in a row writes `agent-poll-failing` to the diagnostics log.
- A pointer moving over the unfocused window re-rendered App twice a second;
  it now does only when the tab in front has a Finished or Failed mark to
  take down.


Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Maxaubert added a commit that referenced this pull request Oct 16, 2026
…(core 0.41.6) (#243)

* fix(indicator): a short-lived Claude no longer leaves its tab marked (core 0.41.6)

The agent mark goes up on Claude's title and only the process poll takes
it back. Since #238 spaced the forced looks, a Claude that lived a few
seconds could come and go between two looks: the poll's "no agent" was
unchanged, so never sent, and the mark stayed. Prism's full e2e caught it
("claude leaving clears the detection", core 0.41.2, twice).

When the title stops naming an agent only the title vouched for, or the
prompt comes back after one, the poll is now asked for its answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

* fix(indicator): only the title's end asks the poll again, not the prompt

MEASURED (Claude Code 2.1.301, 2026-10-16): quitting, Claude writes an
empty title and ConPTY then restores the shell's, so a real exit always
ends the title. Asking on the prompt too wiped the hook state of the
e2e's stand-in agents (a pwsh prompt between steps): 4 agentHooks and
indicator checks failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Oct 16, 2026
…(core 0.41.6) (#243)

* fix(indicator): a short-lived Claude no longer leaves its tab marked (core 0.41.6)

The agent mark goes up on Claude's title and only the process poll takes
it back. Since #238 spaced the forced looks, a Claude that lived a few
seconds could come and go between two looks: the poll's "no agent" was
unchanged, so never sent, and the mark stayed. Prism's full e2e caught it
("claude leaving clears the detection", core 0.41.2, twice).

When the title stops naming an agent only the title vouched for, or the
prompt comes back after one, the poll is now asked for its answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

* fix(indicator): only the title's end asks the poll again, not the prompt

MEASURED (Claude Code 2.1.301, 2026-10-16): quitting, Claude writes an
empty title and ConPTY then restores the shell's, so a real exit always
ends the title. Asking on the prompt too wiped the hook state of the
e2e's stand-in agents (a pwsh prompt between steps): 4 agentHooks and
indicator checks failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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