Skip to content

feat: enable Remote Control (BRIDGE_MODE)#59

Closed
amDosion wants to merge 16 commits into
claude-code-best:mainfrom
amDosion:feat/remote-control-enable
Closed

feat: enable Remote Control (BRIDGE_MODE)#59
amDosion wants to merge 16 commits into
claude-code-best:mainfrom
amDosion:feat/remote-control-enable

Conversation

@amDosion
Copy link
Copy Markdown
Collaborator

@amDosion amDosion commented Apr 2, 2026

Add BRIDGE_MODE to default features, implement stub files, fix system_init default.

Summary by CodeRabbit

  • New Features

    • Added Claude Code Buddy System: an AI companion pet accessible via /buddy commands (on/off/pet subcommands).
    • Enhanced status line displaying model information, context usage metrics, rate limit countdowns, and token utilization.
  • Documentation

    • Added comprehensive Claude Code Buddy System documentation and implementation specifications.
  • Tests

    • Added test coverage for status line countdown formatting.

unraid and others added 16 commits April 2, 2026 17:11
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
移除 shims/、xiaohongshu/、vendor/、旧版 docs、多余 src 组件等 107 个文件

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…st display

Adds a default built-in status line that shows model name, context usage with
token counts, 5h session and 7d weekly rate limit progress bars with countdowns,
and cumulative cost. No configuration needed — displays automatically when no
external statusLine command is configured. Refactors StatusLine.tsx into routing
component with ExternalStatusLine (existing) and BuiltinStatusLineWrapper (new).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify StatusLine.tsx by removing the external shell command path
(ExternalStatusLine, buildStatusLineCommandInput, executeStatusLineCommand).
The built-in status line is now the only implementation — no configuration
needed, shows model, context, session/weekly quotas, and cost by default.
Also adds status line screenshot for documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…st display

Adds a default built-in status line that shows model name, context usage with
token counts, 5h session and 7d weekly rate limit progress bars with countdowns,
and cumulative cost. No configuration needed — displays automatically when no
external statusLine command is configured. Refactors StatusLine.tsx into routing
component with ExternalStatusLine (existing) and BuiltinStatusLineWrapper (new).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify StatusLine.tsx by removing the external shell command path
(ExternalStatusLine, buildStatusLineCommandInput, executeStatusLineCommand).
The built-in status line is now the only implementation — no configuration
needed, shows model, context, session/weekly quotas, and cost by default.
Also adds status line screenshot for documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: built-in status line with usage quota display
- Mock Date.now() in tests to eliminate flakiness from clock drift
- Use currentUsage (same source as contextUsedPct) for usedTokens instead
  of cumulative session totals, fixing data inconsistency
- Switch all imports to src/ path aliases for consistency
- Remove dead feature('KAIROS') gate (always returns false in this build)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/components/BuiltinStatusLine.tsx
#	src/components/StatusLine.tsx
#	src/components/__tests__/BuiltinStatusLine.test.ts
- Add src/buddy/observer.ts: local template-based reactions for name
  mention, test failures, and errors; self-registers on globalThis
- Add /buddy off and /buddy on as aliases for mute/unmute (matches
  original decompiled source)
- Register observer via side-effect import in buddy index.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add BRIDGE_MODE to DEFAULT_FEATURES in dev.ts
- Implement peerSessions.ts: cross-session messaging via bridge API
- Implement webhookSanitizer.ts: redact secrets from GitHub webhook payloads
- Replace any stubs in controlTypes.ts with Zod schema-inferred types
- Fix tengu_bridge_system_init default to true so app shows "active" status

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request introduces a "Claude Code Buddy System" (an AI pet companion feature for Claude Code), refactors status line rendering to use a built-in component instead of dynamic command execution, strengthens SDK type safety with Zod schema validation, implements inter-Claude peer messaging, and enables webhook content sanitization and bridge mode.

Changes

Cohort / File(s) Summary
Buddy System Documentation
docs/claude-buddy-system/README.md, docs/claude-buddy-system/IMPLEMENTATION-PLAN.md
Comprehensive system documentation covering pet generation (FNV-1a hashing, Mulberry32 PRNG), 18 species, rarity/attributes, reaction triggers, lifecycle phases, and implementation roadmap with test strategy.
Buddy System Core Types & Generation
docs/claude-buddy-system/src/buddy/types.ts, docs/claude-buddy-system/src/buddy/companion.ts
New TypeScript modules defining rarity/species/appearance/stat enums, companion data model (bones + soul), deterministic roll logic with memoization, soul generation helpers, and config persistence stubs.
Buddy System UI & Reactions
docs/claude-buddy-system/src/buddy/sprites.ts, docs/claude-buddy-system/src/buddy/CompanionWidget.ts, docs/claude-buddy-system/src/buddy/buddyReaction.ts
ASCII sprite rendering with frame animation, reaction threshold calculation based on message count and addressing, and reaction generation API surface with placeholder fetch implementation.
Buddy System Commands
docs/claude-buddy-system/src/buddy/buddyCommand.ts, src/buddy/observer.ts, src/commands/buddy/buddy.ts, src/commands/buddy/index.ts
Implementation of /buddy subcommands (off/on/pet/default), local reaction detection from test failures/errors/addressing, deterministic template-based responses, and observer registration via global assignment.
Status Line Refactoring
src/components/BuiltinStatusLine.tsx, src/components/StatusLine.tsx, src/components/__tests__/BuiltinStatusLine.test.ts
Replacement of dynamic status line command execution with synchronous built-in rendering. New BuiltinStatusLine component computes usage/rates/costs locally; StatusLine simplified to delegate rendering; includes countdown formatting and test coverage.
SDK Type Safety
src/entrypoints/sdk/controlTypes.ts
Updated 11 exported type aliases from loose/permissive types (string | unknown | any) to Zod schema-inferred types, improving compile-time type safety for control messages.
Bridge & Messaging
src/bridge/peerSessions.ts, src/bridge/webhookSanitizer.ts
Implementation of peer-to-peer inter-Claude messaging with session ID compatibility conversion and HTTP response validation; synchronous webhook content sanitization with configurable payload limits and regex-based secret redaction.
Feature & Hook Updates
scripts/dev.ts, src/hooks/useReplBridge.tsx, .claude/.fuse_hidden0004746300000372
Added BRIDGE_MODE to dev default features; changed bridge system init feature gate default to true; new permissions allowlist granting access to Git, repository search, test/build commands, and GitHub CLI.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • 合并最新主分支 #36: Related updates to src/buddy/companion.ts introducing generateSeed and refactoring getCompanion to use stored seed/rollWithSeed logic, complementing the companion generation system defined in this PR.

Poem

🐾 A digital friend in code so fine,
With ASCII whiskers and stars that shine,
The buddy hops in when tests take flight,
Trading slow commands for instant light!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 74.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 main change: enabling BRIDGE_MODE as a default feature to support remote control functionality.

✏️ 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.

Warning

⚠️ This pull request might be slop. It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

@amDosion
Copy link
Copy Markdown
Collaborator Author

amDosion commented Apr 2, 2026

Recreating with clean branch - only 5 files

@amDosion amDosion closed this Apr 2, 2026
@amDosion amDosion deleted the feat/remote-control-enable branch April 3, 2026 11:34
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