Skip to content

[codex] simplify Blade codebase by 30% - #38

Draft
echoVic wants to merge 55 commits into
mainfrom
refactor/codebase-simplification
Draft

echoVic wants to merge 55 commits into
mainfrom
refactor/codebase-simplification

Conversation

@echoVic

@echoVic echoVic commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • reduce tracked TypeScript/TSX/JavaScript from 593,930 to 413,082 lines
  • remove unused subsystems, compatibility layers, forwarding APIs, and dead test infrastructure
  • consolidate repeated Provider, ACP, PTY, Web, Session, and Agent-loop harnesses
  • replace the broad paid qualification grid with nine high-value production trajectories
  • split Session run state and Agent execution out of the Hono route controller
  • document the resulting architecture and test strategy

Impact

The branch removes 180,848 net lines, a 30.45% reduction from baseline. The default suite now emphasizes deterministic state-machine and protocol tests, while paid real-API qualification covers the production paths that cannot be established locally.

session.ts no longer owns active/recent run storage or the Agent execution loop. Those responsibilities now live in sessionRunState.ts and sessionRunExecutor.ts.

Validation

  • bun run build
  • bun run lint
  • bun run test:all
    • main stage: 464 files passed, 4,626 tests passed
    • performance: 4 files passed, 9 tests passed
  • bun run --filter blade-code test:coverage
    • statements: 66.44%
    • branches: 57.96%
    • functions: 71.01%
    • lines: 67.60%
  • focused Session route/SSE integration tests
  • focused qualification configuration tests

Paid real-API calls were not executed. The release-blocking file selection and credential isolation contract were verified deterministically.

Notes

The working tree contains unrelated local changes that are intentionally not part of this PR.

生产端零调用,仅被单测引用;combineAbortSignals 已覆盖同类场景。
一并移除对应的单测用例。
Task 与 Team 工具原本以 8 个位置参数(Task)和散开的 options 字段(Team)
重复传递同一组委派依赖,getBuiltinTools 还需逐字段转发。引入声明式的
SubagentDelegationDeps 容器统一承载 registry、资源快照与偏好选择器,
以命名依赖注入替代样板透传,并清理由此产生的死 import。

- createTaskTool 改为接收容器,函数体通过解构保持不变
- TeamToolOptions 继承容器,去掉重复且误名的 subagentRegistry 字段
- getBuiltinTools 单次构建容器并复用,公共 opts 签名不变
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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