feat: add system_prompt and allowed_tools to kernel contract#1
Conversation
Wire vigil phase spans, budget metrics, mode transition metrics, and trace context dual-write into the canonical KernelRuntime tick loop: - Phase spans: each loop phase (Perceive, Deliberate, Gate, Execute, Commit, Reflect, Sleep) is wrapped in a vigil::spans::phase_span - Budget metrics: record token/cost budgets in Perceive and Reflect - Mode transitions: detect and record via GenAiMetrics in Reflect - Trace context: write OTel trace_id/span_id into every EventRecord before appending to the event store (dual-write) - Add Commit phase emission before StepFinished/RunFinished events Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add per-tick tool call and file mutation tracking in tick_on_branch. Emit ModeChanged events when OperatingMode transitions occur after tool execution (both success and error paths). Add operating_mode_str helper for Vigil metrics integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend the aiOS kernel contract to support skill-aware agent interactions: - system_prompt on ModelCompletionRequest for liquid prompt injection - allowed_tools on ModelCompletionRequest for skill-based tool filtering - system_prompt and allowed_tools on TickInput, threaded through to provider Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA new Changes
Sequence DiagramsequenceDiagram
participant Kernel as AiosKernel
participant Runtime as AiosRuntime
participant LLM as LLM Model
Kernel->>Runtime: tick_on_branch with TickInput<br/>(system_prompt, allowed_tools)
Runtime->>Runtime: Perceive: Record GenAI<br/>budget metrics
Runtime->>Runtime: Reflect: Create ModelCompletionRequest<br/>populate system_prompt, allowed_tools
Runtime->>LLM: Send request with custom<br/>system prompt & filtered tools
LLM-->>Runtime: Model completion response
Runtime->>Runtime: Record mode transition<br/>& emit EventKind::ModeChanged
Runtime->>Runtime: Write trace context to<br/>event records (OTel integration)
Runtime-->>Kernel: Return tick result with<br/>events & observability data
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
system_prompt: Option<String>toModelCompletionRequestfor liquid prompt injectionallowed_tools: Option<Vec<String>>toModelCompletionRequestfor skill-based tool filteringTickInputwith both fields, threaded through to provider callsPart of the Arcan Skill System Evolution (6-phase implementation). This is the protocol-level foundation that enables skills to inject context and restrict tools.
Test plan
Optionwithserde(default))🤖 Generated with Claude Code
Summary by CodeRabbit