Skip to content

chore: closed - #33

Closed
imbajin wants to merge 15 commits into
xqy2006:mainfrom
imbajin:feat/sqlite-guard
Closed

imbajin wants to merge 15 commits into
xqy2006:mainfrom
imbajin:feat/sqlite-guard

Conversation

@imbajin

@imbajin imbajin commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closed by mistake.

…eshold=2)

When SQLite telemetry detects server-side model downgrade (Safety Buffering)
on consecutive checks, the plugin now triggers a hard taskHalt that the AI
cannot self-clear — only the user can resume via 'guard.mjs resume --halt <id>'.

Changes:
- Default retryCount 3→2 (fingerprint probe threshold)
- Add consecutiveDegradedCount to session state for tracking
- controlContext() handles telemetry-sourced halts with specific messaging
- handleHook() SQLite block: count consecutive degradations, trigger taskHalt
  at threshold (default 2, configurable via MODELTRACE_TELEMETRY_HALT_COUNT)
- queueTelemetryAlert() accepts consecutiveCount/halted options for severe alerts
- resume command resets consecutiveDegradedCount
- New test: two consecutive telemetry degradations trigger taskHalt hard stop
- Existing tests updated for retryCount=2 default
- Eliminate continuation dead loop between Stop hook (decision: block) and Codex autonomous active goal scheduling
- Deliver halt instructions once and avoid returning block on subsequent turns when task is halted
- Pause host thread goal via native thread/goal/set JSON-RPC interface and verify state transitions atomically
- Enforce strict restricted control channel during task halt, allowing status inspection while blocking task work
- Require explicit halt ID on resume and verify host goal unpausing before clearing halt state
- Deduplicate telemetry alerts during halt and prevent healthy telemetry from auto-clearing non-canary halts
- Add multi-turn regression test suite covering loop prevention, status transitions, lock contention, and stdio hook execution
… track subagents

- Extend SQLite telemetry checking to PreToolUse and PostToolUse hooks for real-time circuit breaking in continuous turns
- Persist subagentSessionIds to enable bidirectional cross-thread telemetry correlation
- Resolve parent session in busyHookFallback under lock contention to prevent subagents from bypassing task halt
- Guard alert turn delivery to prevent internal subagent hooks from burning user alert turns
- Enforce strict session isolation in queryLatestRecord when allowGlobalFallback is false
- Add regression tests covering continuous-turn halt, subagent lock contention, cross-thread detection, and alert delivery
@imbajin imbajin closed this Oct 12, 2026
@imbajin imbajin changed the title fix(guard): intercept telemetry degradation during tool execution and track subagents chore: closed Oct 12, 2026
@imbajin
imbajin deleted the feat/sqlite-guard branch October 12, 2026 13:02
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