-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Part of epic #21
Summary
Migrate fast_plan_tasks in swe_af/fast/planner.py from custom AgentAI(...).run() to AgentField's native router.harness() (or potentially .ai() since it uses only 3 turns and no explicit tools).
AgentField now natively supports .harness() and .ai() as first-class primitives — this replaces the custom abstraction.
No dependencies — can be worked independently. Good first issue (single agent, single file).
Agent to migrate
| Agent | File | Current tools | Role |
|---|---|---|---|
fast_plan_tasks |
swe_af/fast/planner.py |
(none specified) | Single-pass task decomposition for FastBuild mode |
Note: This agent uses AgentAIConfig with max_turns=3 and no explicit allowed_tools, so it gets defaults. Check whether it actually needs tool access — if not, .ai() may be more appropriate.
Current pattern
from swe_af.agent_ai import AgentAI, AgentAIConfig
ai = AgentAI(
AgentAIConfig(
provider=ai_provider,
model=pm_model,
cwd=repo_path,
max_turns=3,
permission_mode=permission_mode or None,
)
)
response = await ai.run(
task_prompt,
system_prompt=FAST_PLANNER_SYSTEM_PROMPT,
output_schema=FastPlanResult,
)Target pattern (option A — .harness())
result = await fast_router.harness(
prompt=task_prompt,
schema=FastPlanResult,
provider=provider,
model=pm_model,
max_turns=3,
permission_mode=permission_mode or None,
system_prompt=FAST_PLANNER_SYSTEM_PROMPT,
cwd=repo_path,
)Target pattern (option B — .ai() if no tools needed)
result = await fast_router.ai(
task_prompt,
system=FAST_PLANNER_SYSTEM_PROMPT,
schema=FastPlanResult,
model=pm_model,
)Decision: .harness() vs .ai()
- If the planner needs to read repository files to plan →
.harness() - If it only uses the goal text and context passed in the prompt →
.ai() - Check the prompt template in
swe_af/fast/prompts.pyto determine
Files to modify
swe_af/fast/planner.py—fast_plan_tasks- Remove
from swe_af.agent_ai import AgentAI, AgentAIConfig
Acceptance criteria
-
fast_plan_tasksusesfast_router.harness()orfast_router.ai()instead ofAgentAI.run() - No imports from
swe_af.agent_airemain inswe_af/fast/planner.py - Output schema
FastPlanResultpreserved exactly - Fallback plan (
_fallback_plan) preserved on failure -
max_taskstruncation logic preserved - Provider mapping:
"claude"→"claude-code"(if using.harness())
Tests needed
- Unit test: returns
FastPlanResultdict on success (mock router method) - Unit test: returns fallback plan with
fallback_used=Trueon LLM failure - Unit test: returns fallback plan when parsed response is None
- Unit test: truncates to
max_taskswhen LLM returns too many tasks - Verify
fast/executor.pyandfast/verifier.pyare unaffected (they useapp.call(), notAgentAIdirectly)
Notes
executor.pyandverifier.pyin the fast/ module useapp.call()to dispatch reasoners — they don't useAgentAIdirectly and are NOT affected by this migration- Only
planner.pyhas the directAgentAIimport - Default model is
haiku— cheap, appropriate for fast planning
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed