#19953: Add SoundChain extension + Agent Eye browser bug catcher
size: XL
Cluster:
Security Enhancements and Guardrails
## Summary
- **SoundChain extension** (`extensions/soundchain/`) — 13 tools wrapping the SoundChain music platform API (search, play, trending, discover, leaderboard) + War Room fleet management + Phil Jackson Triangle diagnostic pipeline (7-model Ollama chain for automated bug diagnosis)
- **Agent Eye extension** (`extensions/agent-eye/`) — Passive browser bug catcher. Content script captures user actions (clicks, scrolls, inputs, navigation) and auto-captures errors (JS errors, unhandled rejections, console.error, failed network requests) with full action timelines. 3-layer architecture: content script → Chrome background.js relay → OpenClaw HTTP route → in-memory BugStore. Exposes `agent_eye_bugs`, `agent_eye_status`, `agent_eye_clear` tools + `/eye` command
- **Chrome extension updates** — Added `scripting` permission, `<all_urls>` host permission, and Agent Eye background logic (programmatic content script injection, typed enum state management)
- **Zero booleans in Agent Eye** — All state uses typed string enums (`EYE_MODE`, `BUG_SEVERITY`, `TRIGGER_KIND`, `ACTION_KIND`, `REPORT_VERDICT`) with explicit `===` equality checks. No truthy/falsy patterns
## Test plan
- [ ] `pnpm install` discovers both new workspace packages
- [ ] `tsc --noEmit` compiles clean (verified locally)
- [ ] Load updated Chrome extension in `chrome://extensions`
- [ ] Visit any page, trigger `console.error('test')` in devtools
- [ ] `/eye watch` activates capture, `/eye bugs` shows captured bug with action timeline
- [ ] `agent_eye_bugs` tool returns bugs to LLM for diagnosis
- [ ] `grep -r 'true\|false' extensions/agent-eye/` returns only framework API params (no state booleans)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds two new extensions: **SoundChain** (music platform API + War Room fleet management + Phil Jackson Triangle diagnostic pipeline) and **Agent Eye** (passive browser bug catcher with Chrome content script injection). Also updates the Chrome extension manifest with `scripting` permission and `<all_urls>` host permission.
- **Critical**: Agent Eye's `ctx.sandboxed` check in `extensions/agent-eye/index.ts:397` is inverted — tools are enabled only when `sandboxed === undefined` and disabled when `sandboxed === false`, which is opposite to every other extension in the repo. The tools will not be available in the normal non-sandboxed context.
- **Critical**: Content script re-injection on `tabs.onUpdated` (`background.js:549`) stacks duplicate event listeners and monkey-patches (`console.error`, `window.fetch`, `window.onerror`) with each navigation, causing duplicate bug reports and compounding wrapper chains.
- Both extensions use `Type.Union([Type.Literal(...)])` for tool parameter schemas, which compiles to `anyOf` — the repo explicitly provides `stringEnum`/`optionalStringEnum` helpers to avoid this pattern, as some providers reject `anyOf` schemas.
- The `request()` and `fetchJson()` helpers in `extensions/soundchain/src/api.ts` and `extensions/soundchain/src/warroom.ts` do not check `res.ok` before calling `res.json()`, which will throw on non-JSON error responses.
- `<all_urls>` host permission in the Chrome manifest is a significant scope increase from the previous localhost-only permissions.
<h3>Confidence Score: 2/5</h3>
- Two logic bugs (inverted sandboxed check, content script re-injection stacking) need to be fixed before merging.
- Score of 2 reflects two confirmed logic bugs that would cause runtime misbehavior: (1) Agent Eye tools will not register in the normal non-sandboxed context due to an inverted condition, and (2) content script re-injection on navigation will cause duplicate event listeners and compounding monkey-patches. Additionally, Type.Union usage violates documented repo conventions.
- `extensions/agent-eye/index.ts` (inverted sandboxed check), `assets/chrome-extension/background.js` and `assets/chrome-extension/content-script.js` (re-injection stacking bug)
<sub>Last reviewed commit: ff525cb</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
<!-- /greptile_comment -->
Most Similar PRs
#19935: Add SoundChain extension — music API + War Room diagnostic pipeline
by soundchainio · 2026-02-18
85.7%
#14222: core: add needsApproval to before_tool_call; move AgentShield to ex...
by Eventedge · 2026-02-11
75.3%
#7088: feat: add Camb AI extension
by neilruaro-camb · 2026-02-02
74.7%
#19787: feat: Antigravity Fork - Token Economy, Mem0, sqlite-vec, Auto-Arch...
by msrovani · 2026-02-18
73.8%
#20081: feat: post-compaction triage UX — fuzzy ok + stage-2 gate + Discord...
by PrivacySmurf · 2026-02-18
73.0%
#9763: feat(extensions): add Recoder plugin for AI code generation
by caelum0x · 2026-02-05
73.0%
#7346: Security: add hardening module and secure-bot extension
by AlphonseC · 2026-02-02
72.9%
#17273: feat: add security-guard extension — agentic safety guardrails
by miloudbelarebia · 2026-02-15
72.4%
#19923: feat: track held messages during compaction gate and split verifica...
by PrivacySmurf · 2026-02-18
72.2%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
71.4%