Skip to content

chore: add Entire agent config#402

Merged
KMKoushik merged 1 commit into
mainfrom
chore/add-entire-agent-config
May 18, 2026
Merged

chore: add Entire agent config#402
KMKoushik merged 1 commit into
mainfrom
chore/add-entire-agent-config

Conversation

@KMKoushik
Copy link
Copy Markdown
Member

@KMKoushik KMKoushik commented May 18, 2026

Summary

  • Add Entire-managed hooks for Claude, Codex, Cursor, and OpenCode.
  • Add repository Entire settings and ignore local Entire state.
  • Add Entire history search subagents for Claude and Codex.

Tests

  • Not run (configuration-only changes).

Summary by cubic

Enable Entire across claude-code, codex, cursor, and OpenCode with managed hooks and a search subagent so sessions, prompts, and checkpoints are tracked and searchable. Adds repo-level Entire settings and ignores local state.

  • New Features

    • Entire-managed hooks for claude-code, codex, and cursor events.
    • OpenCode plugin to emit session-start, turn-start/end, compaction, and shutdown hooks.
    • Search subagents for Claude and Codex using entire search --json.
    • Repo config at .entire/settings.json (enabled, telemetry off) and .entire/.gitignore for local state.
  • Migration

    • Install entire and ensure it’s on PATH; hooks no-op if missing.
    • For OpenCode, install Bun to load the plugin.

Written for commit d14560c. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a new search agent for querying history and transcript data via JSON-based queries.
    • Integrated hook handlers across development tools to enable automated CLI-based event processing.
  • Chores

    • Updated configuration settings and permissions for development tool integration.
    • Added new configuration files for feature enablement and sandbox mode settings.

Review Change Stack

Entire-Checkpoint: 69bf47d06770
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
unsend-marketing Ready Ready Preview, Comment May 18, 2026 0:34am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Walkthrough

This PR integrates the "entire" CLI tool for repository history search across multiple IDE environments. It introduces agent prompts for Claude and Codex that constrain searches to entire search --json, adds hook configurations in Claude, Codex, and Cursor settings to invoke the CLI at lifecycle events, sets up the .entire directory with feature configuration, and implements an OpenCode plugin that maintains session state and dispatches OpenCode events to corresponding entire hook commands via Bun subprocesses, with error suppression to prevent crashes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: add Entire agent config' accurately describes the main change: adding configuration for Entire agent integration across multiple tools.
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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying usesend with  Cloudflare Pages  Cloudflare Pages

Latest commit: d14560c
Status: ✅  Deploy successful!
Preview URL: https://a7bbaab4.usesend.pages.dev
Branch Preview URL: https://chore-add-entire-agent-confi.usesend.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 @.opencode/plugins/entire.ts:
- Around line 113-115: The messageStore currently calls messageStore.set(msg.id,
msg) for every message which lets a session grow unbounded; change this to only
retain what you need for turn-start detection by either (a) only storing user
messages (check msg.role === 'user' before calling messageStore.set) or (b)
implementing a small bounded cache/eviction (e.g., per-session ring buffer or
cap N entries and evict oldest) and apply the same change wherever
messageStore.set is used (including the block around lines 142-154); ensure you
still use msg.id for keys but avoid storing assistant/system messages or evict
old entries to keep memory bounded.
- Around line 34-43: callHook (and callHookSync) currently spawns hook
subprocesses without termination controls; update the Bun.spawn option objects
in callHook and callHookSync to include a timeout (e.g., 30000 ms) and a
killSignal (e.g., "SIGKILL") so hung hooks are forcefully terminated; locate the
Bun.spawn(...) calls that use hookCmd(hookName) and add timeout and killSignal
properties to those option objects.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa099ed0-661d-49af-811d-0e875d74efb9

📥 Commits

Reviewing files that changed from the base of the PR and between 04d0f4b and d14560c.

📒 Files selected for processing (9)
  • .claude/agents/entire-search.md
  • .claude/settings.json
  • .codex/agents/entire-search.toml
  • .codex/config.toml
  • .codex/hooks.json
  • .cursor/hooks.json
  • .entire/.gitignore
  • .entire/settings.json
  • .opencode/plugins/entire.ts

Comment on lines +34 to +43
async function callHook(hookName: string, payload: Record<string, unknown>) {
try {
const json = JSON.stringify(payload)
const proc = Bun.spawn(hookCmd(hookName), {
cwd: directory,
stdin: new Blob([json + "\n"]),
stdout: "ignore",
stderr: "ignore",
})
await proc.exited
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

In Bun 1.2, what timeout/termination controls are supported for Bun.spawnandBun.spawnSync, and what is the recommended pattern to enforce a hard timeout for child processes?

💡 Result:

In Bun 1.2, both Bun.spawn and Bun.spawnSync support native timeout and termination controls, allowing you to manage child process lifecycles directly through their configuration options [1][2][3]. Supported Controls: - timeout: You can specify a timeout property (in milliseconds) within the options object [4][5]. If the process exceeds this duration, it is automatically terminated [1][6]. - killSignal: By default, timed-out processes are terminated using SIGTERM [4][1]. You can override this by providing a killSignal option (as a string name or signal number, such as SIGKILL) to specify which signal should be sent upon timeout [1][2][7]. - AbortSignal: Both methods support an AbortSignal via the signal option [8]. If the signal is aborted, the process is terminated using the configured killSignal [2][7]. Recommended Pattern for Hard Timeouts: To enforce a hard timeout, the recommended pattern is to use the built-in timeout and killSignal options directly in the spawn configuration [1][2]. For a "hard" termination that ensures the process cannot ignore the signal, set the killSignal to SIGKILL [1][2]. Example: const proc = Bun.spawn({ cmd: ["sleep", "10"], timeout: 5000, // 5 seconds killSignal: "SIGKILL", // Forceful termination }); await proc.exited; // Resolves after the process exits or is killed

Citations:


Add timeout controls to hook subprocesses using Bun's native options.

callHook and callHookSync spawn external processes without timeout or termination controls. If a hook subprocess hangs, it blocks event-loop processing indefinitely (especially problematic on the sync path). Bun supports native timeout handling via the timeout and killSignal options. Add both to the spawn configuration:

const proc = Bun.spawn(hookCmd(hookName), {
  cwd: directory,
  stdin: new Blob([json + "\n"]),
  stdout: "ignore",
  stderr: "ignore",
  timeout: 30000,  // 30s hard timeout
  killSignal: "SIGKILL",  // Forceful termination
})

Also applies to: 55-63

🤖 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 @.opencode/plugins/entire.ts around lines 34 - 43, callHook (and
callHookSync) currently spawns hook subprocesses without termination controls;
update the Bun.spawn option objects in callHook and callHookSync to include a
timeout (e.g., 30000 ms) and a killSignal (e.g., "SIGKILL") so hung hooks are
forcefully terminated; locate the Bun.spawn(...) calls that use
hookCmd(hookName) and add timeout and killSignal properties to those option
objects.

Comment on lines +113 to +115
// Store message metadata (role, time, tokens, etc.)
messageStore.set(msg.id, msg)
// Track model from assistant messages
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Bound messageStore growth per session.

Line 114 stores every message indefinitely for the session. This can grow unbounded in long-running sessions; only user-message lookup is needed for turn-start detection.

Proposed fix
-            // Store message metadata (role, time, tokens, etc.)
-            messageStore.set(msg.id, msg)
+            // Only store user messages needed for turn-start detection
+            if (msg.role === "user" && msg.id) {
+              messageStore.set(msg.id, msg)
+            }

@@
-            if (msg?.role === "user" && part.type === "text" && !seenUserMessages.has(msg.id)) {
+            if (msg?.role === "user" && part.type === "text" && !seenUserMessages.has(msg.id)) {
               seenUserMessages.add(msg.id)
               const sessionID = msg.sessionID ?? currentSessionID
               if (sessionID) {
                 callHookSync("turn-start", {
                   session_id: sessionID,
                   prompt: part.text ?? "",
                   model: currentModel ?? "",
                 })
               }
+              messageStore.delete(msg.id)
             }

Also applies to: 142-154

🤖 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 @.opencode/plugins/entire.ts around lines 113 - 115, The messageStore
currently calls messageStore.set(msg.id, msg) for every message which lets a
session grow unbounded; change this to only retain what you need for turn-start
detection by either (a) only storing user messages (check msg.role === 'user'
before calling messageStore.set) or (b) implementing a small bounded
cache/eviction (e.g., per-session ring buffer or cap N entries and evict oldest)
and apply the same change wherever messageStore.set is used (including the block
around lines 142-154); ensure you still use msg.id for keys but avoid storing
assistant/system messages or evict old entries to keep memory bounded.

@KMKoushik KMKoushik merged commit dad2941 into main May 18, 2026
8 checks passed
@KMKoushik KMKoushik deleted the chore/add-entire-agent-config branch May 18, 2026 00: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