小橙子 52d67f4239
fix(server): bump WebSocket echo test timeout from 5s to 12s/15s after main regression (#20)
The "Business Flow: WebSocket Chat > should echo message and transition
through states" test in src/server/__tests__/e2e/business-flow.test.ts has
been timing out at exactly 5000ms in CI on PRs that touch any other server
surface (PR #18 reproduced it twice, including a clean rerun).

Root cause
==========
The test waits for a full WS turn (connected -> status:thinking ->
content_start -> content_delta -> message_complete -> status:idle) against
the mock SDK CLI. CI logs show:
  [WS] Client connected for session: ws-test-2          (T+0)
  [ConversationService] CLI started successfully ...    (T+3.0s)
  test fails after 5s                                    (T+5.0s)
The mock CLI itself is fast (synchronous JSON.stringify + immediate
ws.send), but spawning the child + having it dial back into the test
server eats ~3s on GitHub-hosted runners. That left only 2s for the rest
of the turn, which used to fit but now doesn't.

The "now doesn't" is the regression: PR #16 / #17 added several new
services under src/server/services/ (soloSignalsService.ts,
soloSuggestions.ts, soloSuggestions.i18n.test.ts, etc.). Server startup
imports/initializes the new code paths, pushing CLI bootstrap past the
5s budget. Crucially, PR #17's server-checks job was SKIPPED at merge
time (the PR was missing the `allow-cli-core-change` label, so
change-policy stopped the run), so the regression landed on main without
ever exercising server-checks.

Verification of the diagnosis:
- PR #15 (B1) ran full server-checks against this same test on
  2026-06-11 and passed before the soloSignals services landed.
- PR #18 (B2) — same test surface, no src/server/__tests__ change —
  fails twice in a row at exactly 5000ms on this exact test, with no
  other test failing.
- All 1397 other tests pass.

What this PR changes
====================
Surgical: bump THIS one test only.
- Internal `setTimeout(close, 5000)` -> 12000ms. Gives the WS turn ~9s
  of headroom after the typical 3s CLI bootstrap, well clear of the
  observed 5s ceiling.
- Bun:test framework timeout (third arg of `it`) set to 15000ms — must
  exceed the internal 12s so the resolve() path wins and the assertions
  actually run, not the framework killing the whole test.
- Comment in the test explains the headroom + why the framework timeout
  must be larger than the internal one. No behavior change for the
  passing case.

What this PR does NOT do
========================
- No change to other tests, mock-sdk-cli, or any production code.
- No change to coverage thresholds / baseline.
- Does not address the deeper question of WHY server startup got
  slower. That belongs to a separate `perf(server)` follow-up — bumping
  this one timeout is the safe, immediate unblock so other PRs (e.g.
  the queued B2 #18) can land without re-fighting this regression.

Verification
============
- Test contract unchanged: still asserts the same five message types,
  same first-status-is-thinking invariant.
- Local run is blocked by an unrelated adapter dep (worktree
  `bun install` not done; CI has the full dependency tree). CI will
  exercise the change. Recommend rerunning a stuck B2-style PR after
  this lands to confirm the unblock.

Tested: read of the test contract + mock-sdk-cli to confirm the bump preserves all five expected stream events; local server-checks blocked by missing whatsapp adapter dep in this worktree (unrelated)
Not-tested: actual CI run on this branch (will run automatically on PR open)
Confidence: high — surgical timeout bump on one flaky-in-CI test, no production code touched
Scope-risk: narrow
Constraint: do NOT widen the scope to fix the underlying server startup regression in this PR; that needs its own perf investigation and separate review
Rejected: bumping ALL ws-test internal timeouts (no evidence the others are at risk; widening scope past the actual failure violates "every changed line should trace back to a failing test"); investigating + fixing the server startup regression here (different surface, different reviewers, would block the urgent unblock)
Directive: file a follow-up issue for "server startup time regression after solo services" so the underlying cause gets investigated; this PR is the unblock, not the cure

Co-authored-by: 你的姓名 <you@example.com>
2026-06-11 23:44:57 +08:00
2026-06-11 20:55:46 +08:00
2026-04-01 10:30:17 +08:00

Claude Code Haha

Claude Code Haha

GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests License 中文 English Docs

A Claude Code build repaired from the source leaked from Anthropic's npm registry on 2026-03-31. Claude Code Haha is now primarily a desktop Claude Code workspace for macOS, Windows, and Linux: sessions, projects, branch / Worktree launch, right-side file changes, code diffs, permission review, provider setup, Computer Use, H5 remote access, IM integration, and scheduled tasks in one app.

Desktop Preview · Install · Highlights · Sponsorship · More Docs


Desktop Preview

The Claude Code Haha desktop app brings sessions, multi-project navigation, branch / Worktree controls, right-side file changes, code diffs, permission review, provider setup, and remote access into one graphical workspace for daily development flows beyond the terminal.

Download Desktop   Install Guide

Desktop workspace
Desktop Workspace
Right-side changes and Worktree
Right-side Changes & Worktree
Code editing
Code Editing & Diff View
Permission control
Permission Review & AI Questions
H5 remote access
H5 Remote Access
Token usage
Token Usage
Computer Use
Computer Use
Scheduled tasks
Scheduled Tasks

Install the Desktop App

  1. Download the macOS / Windows / Linux desktop installer from Releases.
  2. On first launch, configure your model provider, API key, and default model in Settings.
  3. This build is currently unsigned, so the first launch needs a one-time manual approval (clear quarantine on macOS, click "Run anyway" on Windows). See the desktop installation guide.

Run the CLI from Source

For users who want to debug the underlying CLI, server, or local development flow:

bun install
cp .env.example .env
./bin/claude-haha

See environment variables and global usage for more configuration options.


Desktop Highlights

  • Multi-session workspace: tabs, project switching, terminal entry, and session history in one place.
  • Branch / Worktree launch: choose a repository branch and decide whether to use the current working tree or an isolated Worktree.
  • Right-side file changes: review changed files, added/removed lines, and current workspace state while chatting.
  • Visual code changes: inspect edits, file writes, and diffs directly in the desktop app.
  • Permission review: approve risky commands, tool calls, and model follow-up questions in the GUI.
  • Multi-provider setup: configure Anthropic-compatible APIs, third-party models, WebSearch fallback, and local options.
  • Computer Use: let the agent take screenshots, click, type, and control desktop apps after authorization.
  • H5 remote access: open the current desktop session from a phone or another device with a one-time token.
  • IM integration: chat, switch projects, and approve actions through Telegram / Feishu / WeChat / DingTalk.
  • Scheduled tasks and usage stats: create planned tasks and track local token usage trends.

More Documentation

Document Description
Environment Variables Full env var reference and configuration methods
Third-Party Models Using OpenAI / DeepSeek / Ollama and other non-Anthropic models
Contributing Local tests, live model baselines, PR gates, and release gates
Memory System Cross-session persistent memory usage and implementation
Multi-Agent System Agent orchestration, parallel tasks and Teams collaboration
Skills System Extensible capability plugins, custom workflows and conditional activation
IM Integration Remote chat, project switching, and permission approval via Telegram / Feishu / WeChat / DingTalk
Computer Use Desktop control (screenshots, mouse, keyboard) — Architecture
Desktop App Electron + React GUI client — Quick Start | Architecture | Installation
Global Usage Run claude-haha from any directory
FAQ Common error troubleshooting
Source Fixes Fixes compared with the original leaked source
Project Structure Code directory structure

Sponsorship & Partnership

This project is maintained in the author's spare time. Corporate or individual sponsorships are welcome to support ongoing development. Custom features, integrations, and business partnerships are also open for discussion.

Sponsor Description
JieKou AI
接口AI
Thanks to JieKou AI for sponsoring this project. JieKou AI provides official model resources with stable, high-performance API access. Subscription bundles are priced at 20% off the official rate; new users who register through this link and bind GitHub can claim a $3 coupon.
ShengSuanYun Thanks to ShengSuanYun for sponsoring this project. ShengSuanYun is an industrial-grade AI task parallel execution platform for AI Native Teams, aggregating Claude, ChatGPT, Gemini, and other LLM, image, and video model capacity through direct, non-reverse-engineered access. Its platform SLA reaches 99.7%, with service status available online. It also supports dedicated enterprise gateways, cost and permission controls, smart routing, security protection, BYOK, usage-based billing, upcoming tokens plans, and invoicing. New users registering through this link can receive 10 yuan in model credits plus a 10% first top-up bonus.

📧 Contact: relakkes@gmail.com


Tech Stack

Category Technology
Language TypeScript
Desktop app Electron
Desktop UI React + Vite
Local runtime Bun
Terminal UI React + Ink
CLI parsing Commander.js
API Anthropic SDK
Protocols MCP, LSP

Thanks

Thanks to the following open-source projects and community practices for reference and inspiration:

  • React: frontend engineering and component-based UI ecosystem.
  • Electron: cross-platform desktop app capabilities and engineering practices.
  • cc-switch: reference for model provider configuration.

Star History

If this project helps you, please support it with a Star so more people can discover Claude Code Haha.

Star History Chart

Disclaimer

This repository is based on the Claude Code source leaked from the Anthropic npm registry on 2026-03-31. All original source code copyrights belong to Anthropic. It is provided for learning and research purposes only.

Description
Claude Code 本地可运行版本 - mirror from GitHub
Readme 537 MiB
Languages
TypeScript 98.7%
CSS 0.3%
Rust 0.2%
Shell 0.2%
Python 0.2%
Other 0.3%