ad881cb45d
Loop agent work (since last commit):
- Claude e2e: all 40 tests passing (34 steps + 6 cross-cutting assertions)
- Codex e2e: all 40 tests passing, migrated to @openai/codex-sdk
- Browser e2e: smoke + expanded UX verification passing (Playwright)
- OpenCode e2e: Steps 0-13 passing, 14+ in progress
- Fixed batched message patch semantics (last-write-wins)
- Fixed permission race condition (queue + replay pending transitions)
- Added e2e/setup.ts: auto-boots PGlite server + real daemon
- Added browser.integration.test.ts with Playwright Chrome verification
- Web app Buffer shim fix for happy-sync in browser
Human review session work:
- Traced full data flow: Claude SDK → v3Mapper → SyncBridge → server → app
- Audited side-channels bypassing v3 pipeline (abort, model change, agent
state, session death, usage data)
- Design amendments added to refactor spec:
- Control messages as flat top-level types (AbortRequest, RuntimeConfigChange,
PermissionRequest/Response, SessionEnd)
- Migrate to official @anthropic-ai/claude-agent-sdk (setModel, interrupt)
- Consolidate agent state + metadata into session state cache
- Smart Zustand (SyncNode as single source, fine-grained selectors)
- Strict typing end-to-end, no intermediate types
- Added data flow report: docs/notes/happy-sync-major-refactor-report-for-human.md
- Added loop introspection guide: loop/loop-introspection.md
- Updated loop prompt: commit regularly, clean up orphan processes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Happy Docs
This folder documents how Happy works internally, with a focus on protocol, backend architecture, deployment, and the CLI tool. Start here.
Index
- protocol.md: Wire protocol (WebSocket), payload formats, sequencing, and concurrency rules.
- api.md: HTTP endpoints and authentication flows.
- encryption.md: Encryption boundaries and on-wire encoding.
- backend-architecture.md: Internal backend structure, data flow, and key subsystems.
- deployment.md: How to deploy the backend and required infrastructure.
- cli-architecture.md: CLI and daemon architecture and how they interact with the server.
- dev-environments.md: Local
environments/data/workflow, lab-rat project provisioning,env:clipassthrough behavior, and daemon usage. - session-protocol.md: Unified encrypted chat event protocol.
- session-protocol-claude.md: Claude-specific session-protocol flow (local vs remote launchers, dedupe/restarts).
- plans/provider-envelope-redesign.md: Proposed replacement for the current provider/session envelope design.
- permission-resolution.md: State-based permission mode resolution across app and CLI (including sandbox behavior).
- happy-wire.md: Shared wire schemas/types package and migration notes.
- research/: general research notes and exploratory writeups.
- competition/: competitor research, protocol analysis, and comparison notes.
- competition/AGENTS.md: structure and rules for storing competitor research results without committing raw checkouts.
Conventions
- Paths and field names reflect the current implementation in
packages/happy-server. - Examples are illustrative; the canonical source is the code.