feat: subagent context inheritance in workflow steps#1460
Merged
Conversation
Add SubagentContext to inject parent workflow step outputs into subagent prompts, enabling downstream agents to make context-aware decisions. - Add SubagentContext struct in librefang-types with format_preamble() and truncate_output_preview() helpers - Extend WorkflowStep with optional inherit_context field (per-step override) - Extend AgentManifest with inherit_parent_context (default true) - Update WorkflowEngine::execute_run() to build and inject context preamble into each step's prompt when enabled - Update all call sites (kernel, channel_bridge, API routes, dashboard types) - Add tests for context injection, agent-level disable, step-level override, output truncation, and serde round-trips
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Workflow subagents now receive parent context — previous step outputs are injected into the prompt preamble.
SubagentContextstruct withformat_preamble()for context assemblyinherit_parent_context: bool(default true)inherit_context: Option<bool>overrideChanges
crates/librefang-types/src/subagent.rs— new modulecrates/librefang-types/src/agent.rs—inherit_parent_contexton AgentManifestcrates/librefang-kernel/src/workflow.rs— context injection in all 4 step modescrates/librefang-kernel/src/kernel.rs— resolver returns inherit flagTest plan
Closes #883