• 排查「前端刷新不及时/没有打字机效果」发现现状已是 SSE,不需要换 WebSocket,
    真正缺的是三件独立的事:
    
    - 打字机平滑:后端把 ACP chunk 按 10 字符切片再发 SSE,前端用定时器队列
      (agentChatEvents.js 的 createTypewriterQueue)匀速吐出,抹平网络突发。
    - 打断并发送:执行中解锁输入框,新增 ⤴ 按钮与 ⏹ Stop 视觉区分;stop 端点
      改为轮询确认 agentChatLocks 真正释放(3 秒预算)再返回 cleaned 字段,
      前端据此决定直接发送还是走"强制发送"兜底。顺手修了一个真实并发漏洞:
      同一 agentId + 同一 convId 的并发请求过去完全没有闸门,只是一直靠前端
      textarea 的 disabled 属性侥幸没被触发。
    - 串台加固:把 handleEvent 分发逻辑抽成不依赖组件实例的纯函数
      (agentChatEvents.js),补上 9b1c3f1 那条不变式的回归测试。
    
    已用真实 Claude CLI 会话(非 mock)在浏览器里验证打字机效果、打断并发送
    全流程、以及纯 Stop 无回归。
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01HDtmdnE6pay9BhwZDAKK6M
    yibo authored
     
    Browse File »

  • Final P0 deliverables to make the system bootable in mock mode and
    pass `scripts/phase0-verify.js` + `scripts/phase0-test-call.js` end-to-end.
    
    ClaudeCliProtocol (mock mode):
    - LEMONBOSS_CLAUDE_MODE=mock or { mock: true } in constructor enables
      mock mode. connect() becomes a no-op; sendPrompt reads fixtures from
      fixtures/devloop-mock/{agentName}.json and emits scripted session_update
      chunks + session/result(mock=true). Falls back to default.json.
    
    Agent registry:
    - 6 entries added to system/templates/_registry.json (devloop-pm,
      devloop-architect, devloop-coder, devloop-tester, devloop-integrator,
      devloop-triager).
    - Per-agent dirs system/templates/devloop-{role}/ with:
      * prompt.md   — auto-extracted from agents-{role}.html §2.2
      * config.json — cli.toolPolicy.allowedTools + sandbox.writeAllowList
    
    Tooling:
    - scripts/extract-agent-prompts.js  — regex-extracts §2.2 system prompts
      from 6 agent HTML pages to system/templates/devloop-{role}/prompt.md.
    - server/src/tools/devloop/index.js — central export (tools Map,
      bashHooks, dispatch).
    - server/src/core/devloop/loop-controller.js (P0 skeleton) — exposes
      createProject (sandbox alloc + git init + first commit + timeline) and
      commitAfterAgent (per-agent kind-routed git commit + timeline event).
    
    Mock fixtures:
    - fixtures/devloop-mock/default.json + devloop-pm.json
    
    Acceptance scripts:
    - scripts/phase0-verify.js   — 8 static checks (35 tools loadable,
      6 agents registered, prompt+config wired, bash guard exported, services
      require, fixtures present, git-vault interface, loop-controller).
    - scripts/phase0-test-call.js — 7 end-to-end steps under mock mode
      (createProject → CLI connect → sendPrompt chunks → no-op commit returns
      null → real write commits → git log ≥2 → timeline has both events).
    
    vitest.config.js: include packages/**/*.test.js so the mock smoke test
    runs in the suite.
    
    Results:
    - 162/162 devloop + acp-core tests pass (up from 159).
    - phase0-verify: 8/8.
    - phase0-test-call: 7/7.
    
    Specs: docs/prd/newfunction/_spec/plan-migration.md · Quick-Start step 7
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    yibo authored
     
    Browse File »

  • - Agent as Micro-Container: each agent lives in data/agents/{id}/ with full encapsulation
    - Persona vs Capability split: agent.md (identity) + .claude/skills/main_skill/SKILL.md (workflow)
    - Conversations co-located: data/agents/{id}/conversations/ replaces global dir
    - Meta Skills renamed: meta_hunt, meta_digest, meta_creator, meta_evolving, meta_benchmark, meta_research
    - Dynamic Hot-Reload: AgentManager.getAgentConfig() falls back to filesystem scan
    - Parallel Sub-Agent orchestration via Promise.all with multi-terminal UI
    - Removed SQLite dependency, global skills/ directory, and legacy conversations/
    - Full architecture docs: 18-local-filesystem-first-agent-encapsulation.md
    yibo authored
     
    Browse File »