Skip to content

feat: session degradation watch - alert when an agent's model or permission mode slips#47

Merged
ThinkOffApp merged 1 commit into
mainfrom
feat/degradation-watch
Jul 18, 2026
Merged

feat: session degradation watch - alert when an agent's model or permission mode slips#47
ThinkOffApp merged 1 commit into
mainfrom
feat/degradation-watch

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

What

Petrus (2026-07-18): "yes implement the settings degradation watch claudemm, with notification alert if a model has slipped".

A per-machine daemon (bin/iak-degradation-watch.mjs) that tails watched agents' Claude Code session transcripts and posts a room alert (CodeWatch pushes it to the owner's phone) when:

  • the latest assistant message.model is outside the agent's accepted_models prefix list (e.g. a silent Haiku fallback), or
  • the session's permissionMode differs from expected_permission_mode (e.g. auto-approve silently became manual prompts).

Why

Today an agent's session slipped to Haiku + manual permissions while the owner was out. The degraded agent kept posting - looping on stale tasks, reposting completed instructions - and it cost an evening to diagnose. Both signals were sitting in the transcript the whole time.

Design

  • Immediate alert on first detection (a wrong model in a transcript is a fact, not a flap), 30-min per-signal cooldown, recovery note when restored.
  • Config-driven (degradation_watch block in the daemon config), api key reuses poller.api_key.
  • --once / --dry-run for testing. No dependencies.
  • One instance per machine (transcripts are local). Mini instance is live watching claudemm; MB gets claudemb/codexmb coverage on next pull + config block.

Tested

  • Healthy state: silent (verified live).
  • Simulated model slip + permission slip: both alerts fire with correct text.
  • Live daemon running on the Mini now.

Follow-ups (not this PR)

  • start-all.sh supervision entry (start-all has uncommitted local drift on the Mini; wiring it in should ride the PR that reconciles that drift).
  • CodeWatch amber status dot fed by the same signals via the IAK heartbeat.

@codexmb adversarial review requested (cross-model rule).

🤖 Generated with Claude Code

…ission mode slips

Per-machine daemon reading watched agents' session transcripts:
message.model outside the accepted prefix set, or permissionMode differing
from the expected one, posts an immediate room alert (CodeWatch push) with
30-min cooldown and a recovery note. Born from the 2026-07-18 incident
where a session silently fell back to Haiku with manual permissions and
the degraded agent looped for an evening undiagnosed.

Tested: --dry-run healthy (silent), simulated model+permission slip (both
alerts fire), live daemon running on the Mini watching claudemm.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@ThinkOffApp
ThinkOffApp merged commit ed90319 into main Jul 18, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a035e54fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +118 to +119
await postAlert(cfg, badText);
st.lastAlert = now;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Retry alerts that fail to post

When GroupMind returns a non-2xx response, postAlert only logs and resolves, so this line still advances lastAlert and the first slip is suppressed for the full 30-minute cooldown even though no room/phone alert was delivered. In deployments where the API key is stale or GroupMind has a transient 5xx, the daemon records the signal as alerted and stays quiet; make postAlert report success or throw before updating the cooldown.

Useful? React with 👍 / 👎.

@@ -0,0 +1,175 @@
#!/usr/bin/env node

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark the daemon executable

This new bin script has a shebang but was committed with mode 100644 (checked with git ls-tree; neighboring bin/cli.mjs and bin/iak-mcp-daemon.mjs are 100755). If the process supervisor follows the documented bin/iak-degradation-watch.mjs invocation instead of node ..., startup fails with EACCES, leaving machines unwatched.

Useful? React with 👍 / 👎.

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