Conversation
…n-tree/agent-context primitives Implements five phases of missing primitives for autonomous AI coding harness: Phase 1: Runtime-loaded models.json config (~/.claw/models.json, .claw/models.json) - Custom providers with base URL, API key (literal or env var), and model definitions - Provider-prefixed lookup (e.g. ollama/llama3.1:8b) and bare ID matching - Merged discovery: user-level + project-level providers coexist; same-key project overrides user - Hooks into metadata_for_model, detect_provider_kind, max_tokens_for_model, model_token_limit - Custom provider routing in ProviderClient respects api field (anthropic-messages vs openai-completions) Phase 2: SDK crate with AgentSession, EventBus, SessionManager, ToolRegistry - AgentSession wraps ConversationRuntime with event-driven lifecycle - EventBus provides multi-subscriber broadcast channels for session events - SessionManager handles CRUD for persisted sessions - ToolRegistry and SdkToolExecutor for tool registration/execution stubs Phase 3: Extension system with Extension trait, ExtensionRegistry, SimpleExtension Phase 4: SessionTree with branching/forking/navigation using single-source-of-truth BTreeMap - Children stored as ID references (not duplicated node data) - Fork at any node, navigate between branches Phase 5: AgentContext (thread-safe KV store), AgentTask, TaskRegistry, SessionAgent - Inter-agent communication via shared AgentContext - Task lifecycle management with completion/failure tracking Includes 7 e2e tests for models_file, 27 SDK unit tests, 4 models_file unit tests. All 1,072 workspace tests pass. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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
Implements five phases of missing primitives for building an autonomous AI coding harness comparable to pi-mono/coding-agent.
Phase 1: Runtime models.json Config
Phase 2: SDK Crate (rust/crates/sdk/)
Phase 3: Extension System
Phase 4: Session Tree
Phase 5: Inter-Agent Communication
Test Coverage
Code Review Findings Fixed