Skip to content

feat: General Agent SDK source-sync — full runtime alignment with OpenClaw embedded seam#6

Merged
Redux0223 merged 4 commits intomainfrom
refactor/rename-to-general-agent-sdk
Mar 31, 2026
Merged

feat: General Agent SDK source-sync — full runtime alignment with OpenClaw embedded seam#6
Redux0223 merged 4 commits intomainfrom
refactor/rename-to-general-agent-sdk

Conversation

@Redux0223
Copy link
Copy Markdown
Collaborator

@Redux0223 Redux0223 commented Mar 30, 2026

Summary

Complete implementation of the General Agent SDK source-sync design spec, converting the SDK from a simplified prototype into a production-ready embedded agent runtime aligned with OpenClaw's embedded seam.

Key Changes

Runtime & Core

  • Fix multi-turn conversation memory — agentMessages now correctly accumulate across turns via agent_end event handling
  • Fix API key env var fallback — process.env.ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL are now correctly resolved
  • Implement working compaction runtime with truncation strategy + lifecycle hooks
  • Replace hardcoded 200K context window with dynamic model-based resolution
  • Add transcript repair/validation for robust message ordering
  • Implement restart-safe hosted-tool continuation (single + multi-tool suspensions)
  • Implement first-class subagent runtime with independent child sessions, scoped tools, lifecycle hooks
  • Wire steering messages and follow-up messages into the agent loop
  • Missing credentials now fail loudly (throw Error) — no silent stub completions

Public API Surface

  • Remove all VisionClaw compatibility code and exports (src/compat/visionclaw/*)
  • Standardize all naming on GeneralAgent* prefix
  • Add session lifecycle: listSessions, resumeSession, forkSession, reset, readSessionHistory
  • Add file checkpointing and rollback API
  • Add dynamic MCP server management (stdio + http transports)
  • Expose full 26-hook system (19 SDK-native auto-fired + 7 host-bridged)

Tools

  • Source-sync web_search with Brave/DuckDuckGo dual provider runtime
  • Source-sync web_fetch with readability, Firecrawl integration, SSRF protection
  • Add subagents as core built-in tool (independent child sessions, not host-bridged)
  • Add apply_patch tool with unified diff support
  • Classify all OpenClaw tools: core-built-in / optional / host-bridged / out-of-scope

Documentation (SDK DOCS/)

  • 8 runnable TypeScript examples covering all core features
  • Complete API reference document
  • Updated README with architecture, events, tools, hooks, and integration guide

Acceptance Criteria (15/15 ✅)

All 15 acceptance criteria from the design spec are fully satisfied:

  1. ✅ Autonomous multi-turn tool/model execution
  2. ✅ Source-synced web_search and web_fetch
  3. ✅ Complete tool classification
  4. ✅ Hosted tools suspend/resume same run (restart-safe)
  5. ✅ Structured tool result details
  6. ✅ Session create/continue/resume/fork/list/history/reset
  7. ✅ 26-hook system (19 SDK-native + 7 host-bridged)
  8. ✅ Host-bridged hooks via sdk.emitHook()
  9. ✅ MCP stdio + http transports
  10. ✅ First-class subagent runtime with lifecycle hooks
  11. ✅ Streaming with incremental events + terminal completion
  12. ✅ File checkpointing and rewind
  13. ✅ Missing credentials hard-fail
  14. ✅ VisionClaw code fully removed
  15. ✅ GeneralAgent* naming standardized

Test Plan

  • pnpm run check — TypeScript compilation passes
  • pnpm run build — Production build succeeds
  • pnpm run test — 133 unit/integration tests pass
  • pnpm run test:e2e — Package smoke test passes
  • node scripts/verify-upstream-snapshot.mjs — Provenance verified
  • Real API E2E tests (5/5 pass): basic chat, multi-turn memory, hosted tools, built-in file tools, session lifecycle

Files Changed

  • 106 files changed, 21065 insertions, 1104 deletions
  • New: 66 files (core runtime, tools, hooks, MCP, tests, docs)
  • Modified: 34 files (session, loop, events, types, tests)
  • Deleted: 6 files (VisionClaw compat layer)

- Add description, license (MIT), repository, keywords to package.json
- Update README repo URL to match renamed GitHub repo

Made-with: Cursor
…gnment

Complete implementation of the source-sync design spec, converting the SDK
from a simplified prototype into a production-ready embedded agent runtime
aligned with OpenClaw's embedded seam.

Major changes:

Runtime & Core:
- Fix multi-turn conversation memory (agent_end message accumulation bug)
- Fix API key env var fallback (process.env.ANTHROPIC_API_KEY now works)
- Implement working compaction runtime with truncation strategy
- Replace hardcoded 200K context window with dynamic model resolution
- Add transcript repair/validation for message ordering
- Add restart-safe hosted-tool continuation (single + multi-tool)
- Implement first-class subagent runtime with independent child sessions
- Wire steering messages and follow-up messages into agent loop
- Missing credentials now fail loudly (no silent stub completions)

Public API:
- Remove all VisionClaw compatibility code and exports
- Standardize all naming on GeneralAgent* prefix
- Add session lifecycle: list, resume, fork, reset, history
- Add file checkpointing and rollback API
- Add dynamic MCP server management (stdio + http)
- Expose full 26-hook system (19 SDK-native + 7 host-bridged)

Tools:
- Source-sync web_search with Brave/DuckDuckGo provider runtime
- Source-sync web_fetch with readability, Firecrawl, SSRF protection
- Add subagents as core built-in tool (not host-bridged)
- Add apply_patch tool with unified diff support
- Classify all tools: core-built-in / optional / host-bridged / out-of-scope

Documentation:
- Complete SDK DOCS with 8 runnable examples + API reference
- Update README with full feature documentation
- Update plan and design spec to reflect completion status

Testing:
- 133 unit/integration tests passing
- E2E smoke test passing
- Real API E2E verified (5/5 tests pass)

Made-with: Cursor
@Redux0223 Redux0223 changed the title chore: add package metadata and update repo URL for General Agent SDK feat: General Agent SDK source-sync — full runtime alignment with OpenClaw embedded seam Mar 31, 2026
@Redux0223 Redux0223 merged commit dda283d into main Mar 31, 2026
2 checks passed
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