chore: add Entire agent config#402
Conversation
Entire-Checkpoint: 69bf47d06770
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis 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 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
Deploying usesend with
|
| 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 |
There was a problem hiding this comment.
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
📒 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
| 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 |
There was a problem hiding this comment.
🧩 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:
- 1: https://bun.com/docs/runtime/child-process
- 2: https://bun.com/reference/bun/spawn
- 3: https://bun.com/reference/bun/spawnSync
- 4: https://bun.com/reference/bun/Spawn/SpawnOptions/timeout
- 5: https://bun.com/reference/bun/Spawn/SpawnSyncOptions/timeout
- 6: https://bun.sh/reference/bun/Spawn/SpawnSyncOptions
- 7: https://bun.sh/reference/bun/Spawn
- 8: Add
signalandtimeoutoptions tospawnandspawnSyncoven-sh/bun#1788
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.
| // Store message metadata (role, time, tokens, etc.) | ||
| messageStore.set(msg.id, msg) | ||
| // Track model from assistant messages |
There was a problem hiding this comment.
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.
Summary
Tests
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
claude-code,codex, andcursorevents.session-start,turn-start/end, compaction, and shutdown hooks.entire search --json..entire/settings.json(enabled, telemetry off) and.entire/.gitignorefor local state.Migration
entireand ensure it’s on PATH; hooks no-op if missing.Bunto load the plugin.Written for commit d14560c. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Features
Chores