fix: resolve 43 pre-existing TypeScript errors in src/#257
Closed
amDosion wants to merge 2 commits intoclaude-code-best:mainfrom
Closed
fix: resolve 43 pre-existing TypeScript errors in src/#257amDosion wants to merge 2 commits intoclaude-code-best:mainfrom
amDosion wants to merge 2 commits intoclaude-code-best:mainfrom
Conversation
added 2 commits
April 13, 2026 23:15
Squashed merge of 5 feature branches: 1. fix/mcp-tsc-errors — 修复上游 MCP 重构后的 tsc 错误和测试失败 2. feat/pipe-mute-disconnect — Pipe IPC 逻辑断开、/lang 命令、mute 状态机 3. feat/stub-recovery-all — 实现全部 stub 恢复 (task 001-012) 4. feat/kairos-activation — KAIROS 激活解除阻塞 + 工具实现 5. codex/openclaw-autonomy-pr — 自治权限系统、运行记录、managed flows Daemon 重构 (task 013-016): - BgEngine 跨平台引擎抽象 (TmuxEngine + DetachedEngine) - /daemon 命令层级化 (CLI + REPL 双注册) - /job 命令层级化 (CLI + REPL 双注册) - 旧命令向后兼容 (ps/logs/attach/kill/new/list/reply → deprecation) - 12 个新测试
- REPL.tsx: add missing getCwd and toError imports - send.ts: add missing removeSendOverride import - spawnInProcess.ts: capture pendingAutonomyRunIds inside setAppState callback to avoid referencing out-of-scope teammateTask variable - InProcessTeammateTask.tsx: replace conditional spread with typed locals to fix origin type widening; use MessageOrigin instead of Message['origin'] (which resolves to unknown due to index signature) - autonomyRuns.ts: introduce PersistedAutonomyRunRecord type and normalizePersistedRunRecord function for proper type narrowing - autonomy.test.ts: add expectTextResult helper for LocalCommandResult union narrowing; add null checks for createAutonomyQueuedPrompt - autonomyRuns.test.ts: add non-null assertions after expect guards - proactive.baseline.test.ts: remove extraneous 3rd argument to local-jsx command call()
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughIntroduces comprehensive autonomy management system with background session engine abstraction (tmux/detached), template/job state management, proactive mode activation with heartbeat tasks, managed autonomy flow orchestration, assistant session discovery, pipe muting controls, language preference system, daemon state persistence, and extensive test coverage across all new systems. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant REPL
participant AutonomyRuns
participant AutonomyFlows
participant HeartbeatTask
participant ManagedStep
User->>REPL: Trigger proactive tick / scheduled task
activate REPL
REPL->>AutonomyRuns: createAutonomyQueuedPrompt()
activate AutonomyRuns
AutonomyRuns->>AutonomyFlows: Check for managed flows
activate AutonomyFlows
AutonomyFlows-->>AutonomyRuns: Flow metadata (if exists)
deactivate AutonomyFlows
AutonomyRuns->>HeartbeatTask: Load & parse heartbeat authority
activate HeartbeatTask
HeartbeatTask-->>AutonomyRuns: Due tasks with steps
deactivate HeartbeatTask
AutonomyRuns->>AutonomyRuns: Create queued run + persist
AutonomyRuns-->>REPL: QueuedCommand with autonomy metadata
deactivate AutonomyRuns
REPL->>REPL: Enqueue command for execution
REPL->>REPL: markAutonomyRunRunning(runId)
REPL->>REPL: Execute LLM turn
REPL->>ManagedStep: finalizeAutonomyRunCompleted(runId)
activate ManagedStep
ManagedStep->>AutonomyFlows: Advance flow to next step
activate AutonomyFlows
AutonomyFlows-->>ManagedStep: Next step (if any)
deactivate AutonomyFlows
ManagedStep-->>REPL: Follow-up commands
deactivate ManagedStep
REPL->>REPL: Enqueue follow-up commands
deactivate REPL
REPL-->>User: Display autonomy run status
sequenceDiagram
participant CLI
participant SelectEngine
participant TmuxEngine
participant DetachedEngine
participant Session
CLI->>CLI: `claude --bg` or `daemon bg` invoked
activate CLI
CLI->>SelectEngine: selectEngine()
activate SelectEngine
alt Platform is Windows
SelectEngine->>DetachedEngine: new DetachedEngine()
activate DetachedEngine
SelectEngine-->>CLI: DetachedEngine instance
deactivate DetachedEngine
else Platform is Unix-like
SelectEngine->>TmuxEngine: new TmuxEngine()
activate TmuxEngine
TmuxEngine->>TmuxEngine: check tmux availability
alt Tmux available
SelectEngine-->>CLI: TmuxEngine instance
deactivate TmuxEngine
else Tmux unavailable
SelectEngine->>DetachedEngine: new DetachedEngine()
activate DetachedEngine
SelectEngine-->>CLI: DetachedEngine instance
deactivate DetachedEngine
end
end
CLI->>Session: engine.start(opts)
activate Session
Session->>Session: Spawn process / create tmux session
Session-->>CLI: BgStartResult { pid, sessionName, logPath, engineUsed }
deactivate Session
CLI->>Session: Persist session entry with engine field
deactivate CLI
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150+ minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsc --noEmiterrors insrc/directory, bringing the count from 43 to 0as anypatches), validated via Codex external reviewChanges by Category
Production Code (5 files)
REPL.tsxgetCwdandtoErrorimportsutils/cwd.jsandutils/errors.jssend/send.tsremoveSendOverrideimportpipeMuteState.jsimportspawnInProcess.tsteammateTaskreferenced outsidesetAppStatecallback scopependingAutonomyRunIdsinside callback, use afterInProcessTeammateTask.tsx{} | undefinedtype widening;Message['origin']resolves tounknownMessageOrigintypeautonomyRuns.ts.map()return type doesn't matchAutonomyRunRecord[]PersistedAutonomyRunRecordtype +normalizePersistedRunRecord()Test Code (3 files)
autonomy.test.tsresult.valueonLocalCommandResultunion without narrowingexpectTextResult()assertion helperautonomyRuns.test.tscommand/first/secondfromcreateAutonomyQueuedPromptexpect().not.toBeNull()+!assertionsproactive.baseline.test.tsmod.call()called with 3 args, signature expects 2Test plan
bunx tsc --noEmit— src/ errors: 0 (was 43)bun test— 2757 pass / 1 fail (Langfuse test, pre-existing)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
daemon ps/logs/attach/kill).Documentation