Skip to content

Address CodeRabbit review: timeout, session-id guard, CI hardening - #2

Merged
rakshith48 merged 1 commit into
mainfrom
fix/coderabbit-hardening
Jun 16, 2026
Merged

rakshith48 merged 1 commit into
mainfrom
fix/coderabbit-hardening

Conversation

@rakshith48

@rakshith48 rakshith48 commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Applies the actionable findings from the CodeRabbit review (PR #1).

  • api() timeout — AbortController bounds every Firecrawl call (FIRECRAWL_HTTP_TIMEOUT_MS, default 60s), so a stalled request can't block the plugin's single response.
  • session.id guard — browser.launch now validates session.id as well as cdpUrl; prevents reporting success when the session can't be closed later (leak).
  • CI — persist-credentials: false on checkout.
  • Tests — added a no-session-id case (10 total, still hermetic).

Deliberately skipped: SHA-pinning the GitHub Actions (@v4 → commit SHA). CI is hermetic (no secrets, no deploy, no publish), so the maintenance cost outweighs the supply-chain benefit here.

Verified: node --test (10/10) + live launch/close against the real Firecrawl API.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • HTTP requests now include a 60-second timeout to prevent indefinite waiting.
    • Browser session responses are now validated to ensure proper initialization configuration.

- api(): bound fetch with AbortController (FIRECRAWL_HTTP_TIMEOUT_MS, default
  60s) so a stalled call can't block the single response
- browser.launch: validate session.id (not just cdpUrl) so we never report
  success without a closable session
- ci.yml: persist-credentials: false on checkout
- test: add no-session-id guard case (10 tests total)

Skipped CodeRabbit's SHA-pinning suggestion: CI is hermetic (no secrets/deploy),
so the maintenance cost outweighs the benefit for this repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f89b6e3-1b72-4f6e-a25e-f40a1e47a4ce

📥 Commits

Reviewing files that changed from the base of the PR and between e7bb866 and fdc9da2.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • bin/plugin.js
  • test/plugin.test.js

📝 Walkthrough

Walkthrough

The api() helper in bin/plugin.js gains an AbortController-based HTTP timeout configurable via FIRECRAWL_HTTP_TIMEOUT_MS (default 60 s), converting timeouts into a typed error. The browser.launch path adds a session.id presence check. Tests cover the missing-session-id failure path. The CI workflow disables credential persistence on checkout.

Changes

Plugin HTTP Timeout and Session ID Validation

Layer / File(s) Summary
HTTP timeout, session.id validation, and tests
bin/plugin.js, test/plugin.test.js
api() wraps fetch with an AbortController timeout (default 60 s via FIRECRAWL_HTTP_TIMEOUT_MS), clears the timer in finally, and converts AbortError into a timeout-specific error. browser.launch adds a session.id guard alongside the existing cdpUrl check. The mock server gains a ttl===999 branch that omits id, and a new test verifies the launch fails with an error matching /session id/.

CI Credential Persistence Hardening

Layer / File(s) Summary
Disable persist-credentials in CI checkout
.github/workflows/ci.yml
Adds persist-credentials: false to the actions/checkout@v4 step.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A rabbit hops in, checks the clock on each call,
No fetch shall hang stalled in an infinite stall.
The session needs id—without it, we fail,
And credentials vanish like snow in a gale.
Bounded and guarded, the burrow stays tight! 🕐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the three main changes: timeout handling, session-id validation, and CI hardening—matching the core objectives and file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/coderabbit-hardening

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

@rakshith48
rakshith48 merged commit 36872cc into main Jun 16, 2026
4 checks passed
@rakshith48
rakshith48 deleted the fix/coderabbit-hardening branch June 16, 2026 21:38
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