Skip to content

[codex] fix(query): abort active work on QueryGuard timeout - #1623

Merged
kevincodex1 merged 4 commits into
Twigpine:mainfrom
chioarub:codex/queryguard-timeout-abort
Jun 15, 2026
Merged

kevincodex1 merged 4 commits into
Twigpine:mainfrom
chioarub:codex/queryguard-timeout-abort

Conversation

@chioarub

@chioarub chioarub commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a QueryGuard timeout callback so the REPL owner is notified when the watchdog fires.
  • Abort the active AbortController on timeout before QueryGuard.forceEnd() releases the guard.
  • Reuse the existing aborted-turn cleanup path for loading state, token budget state, and turn completion notifications.

Root Cause

QueryGuard force-ended its internal state after five minutes, which hid the spinner but did not abort the active query generator. If the provider stream or tool path remained stuck, the underlying work could continue after the UI appeared idle.

Impact

A watchdog timeout now actively interrupts the running query instead of only resetting local guard state. This keeps stale provider/tool work from surviving behind an idle prompt and aligns timeout behavior with the existing abort semantics.

Validation

  • bun test src/utils/QueryGuard.test.ts
  • bun run typecheck
  • bun run smoke
  • bun run scripts/pr-intent-scan.ts --base upstream/main
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added a watchdog-style query timeout for the REPL to prevent long-running queries from stalling.
    • When the timeout fires, the active request is aborted, REPL loading state is cleared, and turn completion is triggered (including token-budget cleanup when enabled).
  • Tests

    • Added and expanded fake-timer coverage for timeout invocation, disposer cancellation behavior, and error handling (including guaranteed cleanup/transition to inactive and expected error logging).

@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81c709de-de02-435d-8997-165f00f2eb4c

📥 Commits

Reviewing files that changed from the base of the PR and between 32b210f and 80e8806.

📒 Files selected for processing (1)
  • src/utils/QueryGuard.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: smoke-and-tests
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/utils/QueryGuard.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/utils/QueryGuard.test.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/utils/QueryGuard.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/utils/QueryGuard.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes fix: skip assertMinVersion for third-party providers #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/utils/QueryGuard.test.ts
🔇 Additional comments (5)
src/utils/QueryGuard.test.ts (5)

1-1: LGTM!


5-8: LGTM!


62-74: LGTM!


76-88: LGTM!


90-104: LGTM!


📝 Walkthrough

Walkthrough

Adds a watchdog timeout handler API to QueryGuard via a new setTimeoutHandler method that stores a QueryTimeoutHandler callback and returns a disposer. When the watchdog fires, it calls the handler then unconditionally calls forceEnd(). The REPL component registers an abortTimedOutQuery callback that aborts the active AbortController, clears token budget state, and schedules UI cleanup via queueMicrotask.

Changes

Query Timeout Backstop

Layer / File(s) Summary
QueryGuard timeout handler API and watchdog invocation
src/utils/QueryGuard.ts
Introduces QueryTimeoutHandler type, _timeoutHandler field, and setTimeoutHandler(handler): () => void with a same-reference disposer guard. Updates watchdog path to call the handler inside try/catch, log handler failures, then always invoke forceEnd() in a finally block.
QueryGuard timeout handler tests
src/utils/QueryGuard.test.ts
Centralizes cleanup with afterEach that restores real timers and resets mocks. Three test cases verify handler invocation at the 5-minute deadline and guard inactive state, disposer cleanup prevents handler from firing even after timeout elapses, and error handling catches handler exceptions without propagating to timer advance while guard becomes inactive.
REPL timeout wiring
src/screens/REPL.tsx
Adds abortTimedOutQuery callback that aborts the current AbortController with reason "query-timeout", clears the TOKEN_BUDGET snapshot when enabled, and enqueues a microtask to call resetLoadingState, clear abort controller state, and invoke mrOnTurnComplete(messagesRef.current, true). A useEffect registers this as the queryGuard timeout handler.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Risk Surface Disclosed ⚠️ Warning PR touches provider routing/background execution risk areas (mentions "provider stream" and tool paths continuing in background) but lacks reviewer callout documenting risk surface assessment or bl... Add review comment explicitly addressing: (1) what risk the provider stream timeout introduces, (2) whether it's acceptable/non-blocking, (3) any provider-specific considerations for aborting mid-stream.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely describes the main change: aborting active work on QueryGuard timeout, matching the diff scope.
Description check ✅ Passed Description covers changes, root cause, and impact. Validation section documents testing approach, though some template checkboxes are not explicitly marked.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Hidden Policy Change ✅ Passed No hidden policy changes detected. The PR adds timeout callback mechanism and abort logic to QueryGuard without modifying product, trust-model, routing-default, telemetry, or permission-policy beha...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/QueryGuard.ts`:
- Around line 157-161: The _timeoutHandler callback invocation in the QueryGuard
try-finally block can throw exceptions that escape the timer callback and crash
the Node process. Wrap the _timeoutHandler?.(this._generation) call in an inner
try-catch block to catch and swallow any exceptions thrown by the timeout
handler, ensuring that forceEnd() still executes in the finally block and the
error does not propagate up and terminate the process.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aecbcf18-55fe-45e5-be72-0fa2d202d4c6

📥 Commits

Reviewing files that changed from the base of the PR and between 716c1d4 and 436793d.

📒 Files selected for processing (3)
  • src/screens/REPL.tsx
  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: smoke-and-tests
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
  • src/screens/REPL.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
  • src/screens/REPL.tsx
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
  • src/screens/REPL.tsx
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/utils/QueryGuard.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
  • src/screens/REPL.tsx
🔇 Additional comments (3)
src/utils/QueryGuard.ts (1)

119-131: LGTM!

src/utils/QueryGuard.test.ts (1)

59-89: LGTM!

src/screens/REPL.tsx (1)

1729-1749: LGTM!

Comment thread src/utils/QueryGuard.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/QueryGuard.test.ts`:
- Around line 91-108: The test `timeout handler errors do not escape the
watchdog callback` modifies global state by calling `vi.useFakeTimers()` and
`vi.spyOn()`, but the cleanup code that calls `consoleError.mockRestore()` and
`vi.useRealTimers()` is not failure-safe. Wrap the test body logic in a
try/finally block so that the cleanup code in the finally block always executes,
even if an assertion fails, ensuring test isolation is preserved and global
timer and mock state is properly restored.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8affd3cb-2464-4221-b315-bf22cfc5ca85

📥 Commits

Reviewing files that changed from the base of the PR and between 436793d and 5e74b30.

📒 Files selected for processing (2)
  • src/utils/QueryGuard.test.ts
  • src/utils/QueryGuard.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: typecheck
  • GitHub Check: smoke-and-tests
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/utils/QueryGuard.ts
  • src/utils/QueryGuard.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/utils/QueryGuard.ts
  • src/utils/QueryGuard.test.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/utils/QueryGuard.ts
  • src/utils/QueryGuard.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/utils/QueryGuard.ts
  • src/utils/QueryGuard.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/utils/QueryGuard.test.ts
🔇 Additional comments (1)
src/utils/QueryGuard.ts (1)

159-160: LGTM!

Comment thread src/utils/QueryGuard.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/QueryGuard.test.ts (1)

59-73: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Apply the same try/finally pattern for timer cleanup in tests 1 and 2.

Both tests mutate global timer state with vi.useFakeTimers() but rely on line-of-sight cleanup with vi.useRealTimers() at the end. If an assertion fails, the real timers won't be restored, leaking state into subsequent tests. Wrap each test body in try/finally as done in test 3 (lines 96-109) for consistency and reliable isolation.

Proposed fix

For test 'timeout notifies owner with the timed-out generation' (lines 59-73):

   test('timeout notifies owner with the timed-out generation', () => {
     vi.useFakeTimers()
-    const guard = new QueryGuard()
-    const onTimeout = vi.fn()
-    guard.setTimeoutHandler(onTimeout)
-
-    const gen = guard.tryStart()!
-    vi.advanceTimersByTime(5 * 60 * 1000)
-
-    expect(onTimeout).toHaveBeenCalledTimes(1)
-    expect(onTimeout).toHaveBeenCalledWith(gen)
-    expect(guard.isActive).toBe(false)
-
-    vi.useRealTimers()
+    try {
+      const guard = new QueryGuard()
+      const onTimeout = vi.fn()
+      guard.setTimeoutHandler(onTimeout)
+
+      const gen = guard.tryStart()!
+      vi.advanceTimersByTime(5 * 60 * 1000)
+
+      expect(onTimeout).toHaveBeenCalledTimes(1)
+      expect(onTimeout).toHaveBeenCalledWith(gen)
+      expect(guard.isActive).toBe(false)
+    } finally {
+      vi.useRealTimers()
+    }
   })

For test 'timeout handler cleanup prevents stale notification' (lines 75-89):

   test('timeout handler cleanup prevents stale notification', () => {
     vi.useFakeTimers()
-    const guard = new QueryGuard()
-    const onTimeout = vi.fn()
-    const cleanup = guard.setTimeoutHandler(onTimeout)
-    cleanup()
-
-    guard.tryStart()
-    vi.advanceTimersByTime(5 * 60 * 1000)
-
-    expect(onTimeout).not.toHaveBeenCalled()
-    expect(guard.isActive).toBe(false)
-
-    vi.useRealTimers()
+    try {
+      const guard = new QueryGuard()
+      const onTimeout = vi.fn()
+      const cleanup = guard.setTimeoutHandler(onTimeout)
+      cleanup()
+
+      guard.tryStart()
+      vi.advanceTimersByTime(5 * 60 * 1000)
+
+      expect(onTimeout).not.toHaveBeenCalled()
+      expect(guard.isActive).toBe(false)
+    } finally {
+      vi.useRealTimers()
+    }
   })

Also applies to: 75-89

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/utils/QueryGuard.test.ts` around lines 59 - 73, Both the test 'timeout
notifies owner with the timed-out generation' (lines 59-73) and the test
'timeout handler cleanup prevents stale notification' (lines 75-89) mutate
global timer state with vi.useFakeTimers() but only call vi.useRealTimers() at
the end without protection. If any assertion fails before cleanup, real timers
won't be restored, leaking state to subsequent tests. Wrap each test body in a
try/finally block where vi.useFakeTimers() is called before the try block and
vi.useRealTimers() is called in the finally block, following the same pattern
already established in the third test. This ensures reliable timer restoration
regardless of test outcome.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/utils/QueryGuard.test.ts`:
- Around line 59-73: Both the test 'timeout notifies owner with the timed-out
generation' (lines 59-73) and the test 'timeout handler cleanup prevents stale
notification' (lines 75-89) mutate global timer state with vi.useFakeTimers()
but only call vi.useRealTimers() at the end without protection. If any assertion
fails before cleanup, real timers won't be restored, leaking state to subsequent
tests. Wrap each test body in a try/finally block where vi.useFakeTimers() is
called before the try block and vi.useRealTimers() is called in the finally
block, following the same pattern already established in the third test. This
ensures reliable timer restoration regardless of test outcome.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 15fc46f3-5c54-4eff-86eb-adf0cc23466f

📥 Commits

Reviewing files that changed from the base of the PR and between 5e74b30 and 32b210f.

📒 Files selected for processing (1)
  • src/utils/QueryGuard.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: smoke-and-tests
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/utils/QueryGuard.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/utils/QueryGuard.test.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/utils/QueryGuard.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/utils/QueryGuard.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/utils/QueryGuard.test.ts
🔇 Additional comments (1)
src/utils/QueryGuard.test.ts (1)

96-109: LGTM!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 14, 2026

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution. I do not see any actionable issues from my review.

@kevincodex1 LGTM

@kevincodex1 kevincodex1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kevincodex1
kevincodex1 merged commit 174ebd5 into Twigpine:main Jun 15, 2026
4 checks passed
@chioarub
chioarub deleted the codex/queryguard-timeout-abort branch June 15, 2026 05:55
deagwon97 pushed a commit to deagwon97/openclaude that referenced this pull request Jun 15, 2026
…#1623)

* fix(query): abort active work on QueryGuard timeout

* fix(query): contain timeout handler failures

* test(query): harden timeout handler cleanup

* test(query): centralize QueryGuard timer cleanup
hotmanxp added a commit to hotmanxp/openclaude that referenced this pull request Jul 4, 2026
Port provider-agnostic timeout abort mechanism to OpenCC. The
upstream `[codex]` tag is misleading — the change hooks QueryGuard's
timeout to abort in-flight work, which OpenCC needs as substrate for
the Twigpine#1682 lifecycle port. Codex-specific paths are excluded per
provider policy.

Upstream SHA: 174ebd5
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.

3 participants