Skip to content

feat(pip): give late AI quips their own window and keep limits in main - #333

Merged
maxthomas95 merged 1 commit into
mainfrom
feat/pip-ai-lifecycle
Nov 12, 2026
Merged

maxthomas95 merged 1 commit into
mainfrom
feat/pip-ai-lifecycle

Conversation

@maxthomas95

Copy link
Copy Markdown
Owner

Pip plan PR 5 (AI quip lifecycle).

  • Late replies. While a request is pending, the local line stays up instead of expiring under it, for up to 25 s. A quip that lands gets a full 12 s from arrival. A failed or declined request leaves the local line with whatever is left of its own 12 s. A newer moment, or the end of the state the line describes, still discards a pending reply.
  • One cooldown. The renderer no longer keeps its own copy of the 2-minute cooldown. Main enforces the cooldown and the hourly cap, and the status line shows the reason it returns.
  • No phantom attempts. A moment that ends before the 600 ms request delay sends nothing and cancels nothing, so it consumes no attempt. A test covers this.
  • Events. longTurn joins PIP_AI_EVENTS. crashed, delegated and nudges stay local, and the handler test asserts they are rejected.
  • Situations. Requests carry a plain-language situation next to the event id (PIP_AI_SITUATIONS), so the model is not guessing what dizzy or attention mean.

Docs: src/docs/settings.md (Optional AI quips).

Tests: 5 new panel lifecycle tests, plus assertions on the handler allowlist and the Codex turn input. vitest passes on renderer, pip, codex and pip-handlers (1054 tests), and tsc --noEmit is clean. Lint reports no new findings; the two existing sonarjs warnings in these files are unchanged.

🤖 Generated with Claude Code

A quip that arrived late got only what was left of the local line's 12
seconds, and the line could expire under a pending request, which then
cancelled a reply that had already been paid for. The local line now
stays up while a request is pending (capped at 25 s), a quip that lands
gets a full 12 s from arrival, and a failed request leaves the local
line with the rest of its own time.

The AI cooldown was enforced in both the renderer and main. The
renderer copy is gone: main decides and the status line shows the
reason it returns. A moment that ends before the 600 ms request delay
never reaches main and consumes no attempt.

Long turns may now ask for a quip; crashes, helpers joining and nudges
stay local. Requests also carry a plain-language situation, so the
model is not guessing what an event id like "dizzy" means.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@maxthomas95
maxthomas95 merged commit 2d22c0b into main Nov 12, 2026
11 checks passed
@maxthomas95
maxthomas95 deleted the feat/pip-ai-lifecycle branch November 12, 2026 21:46
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