Repository navigation
Description
Problem Description
A pydantic-ai agent run does not get the style rules of src/devops_cli/ai/tasks/style_ste100.md. Only LLMClient adds them: with_style_request has two callers, src/devops_cli/ai/client/unified.py and src/devops_cli/ai/client/structured.py. These runs send their prompt with no style request:
devops ai chat:src/devops_cli/commands/ai.pybuilds the persona agent withbuild_agentfromsrc/devops_cli/ai/client/factory.py.investigateinsrc/devops_cli/roadmap/refine/refine_investigation.py, which the refine investigation, the stage toolbox planner (src/devops_cli/roadmap/stage/stage_toolbox.py) and the alternatives check (src/devops_cli/roadmap/alternatives.py) call.- The implement step agent of
src/devops_cli/roadmap/implement/implement_step.py.
So these runs do not get the ASD-STE100 rules (#1866) or the rule to give the bottom line in the first line (#5419). The text that they write for a person, such as a plan, a refined issue or a chat reply, does not follow the rules that AGENTS.md rule 9 sets.
Reproduction Steps
git grep -n with_style_request -- srcgit grep -n "build_agent(" -- srcgit grep -n "investigate(" -- src
Expected vs Actual Behavior
Expected: each model call that writes text for a person gets the style request, as the docstring of src/devops_cli/ai/client/style_request.py says ("every free-text model call carries").
Actual: only the calls of LLMClient get it. The agent runs above send their instructions with no style request.
Environment Diagnostics
origin/main at the release 0.129.0.
Logs, Traces, or Terminal Output
git grep -n with_style_request -- src shows the two callers in unified.py and structured.py and no other caller.
Pre-Submission Checklist
- I searched the open issues for "build_agent", "style_request" and "ASD-STE100". No issue covers it.
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: pydantic-ai (https://pypi.org/project/pydantic-ai), MIT, last activity 2026-11-28, maintained.
Reason: Searches found no external tool that supplies ASD-STE100 style rules, but pydantic-ai, the agent framework the project already uses, sends agent instructions on every run, so the style text only needs wiring into the builders.
Covers:
- Instructions attached to an agent are sent on every run
- Static and per-run dynamic instructions hooks
- One shared builder can serve chat, investigate and implement agents
Lacks:
- No ASD-STE100 rule text or loader
- No styling of the separate implement-step builder
- No check that every builder carries the style request
Proposed design
Problem statement
A pydantic-ai agent run sends its instructions without the ASD-STE100 style request. Only LLMClient adds the style request. Chat, investigate and implement-step agents write prose that ignores AGENTS.md rule 9. The fix adds the style request to the agent builders.
Acceptance criteria
Requirement: Factory agent carries the style request
The factory build_agent SHALL add the style request to the instructions of every agent it builds.
Scenario: Factory agent instructions
- WHEN A test calls
build_agentfromsrc/devops_cli/ai/client/factory.pywith a system prompt. - THEN The test asserts that the agent instructions contain the text from
with_style_requestfor that prompt.
Requirement: Implement-step agent carries the style request
The implement-step agent builder SHALL add the style request to the instructions of its agent.
Scenario: Implement-step agent instructions
- WHEN A test builds the implement-step agent from
src/devops_cli/roadmap/implement/implement_step.py. - THEN The test asserts that the agent instructions contain the text of
src/devops_cli/ai/tasks/style_ste100.md.
Requirement: Chat agent carries the style request
The chat persona agent SHALL use the styled builder when devops ai chat creates it.
Scenario: Chat agent instructions
- WHEN A test builds the chat persona agent through
src/devops_cli/commands/ai.py. - THEN The test asserts that the agent instructions contain the style text.
Requirement: Investigate agent carries the style request
The investigate path SHALL use the styled builder for every agent it creates.
Scenario: Investigate agent instructions
- WHEN A test calls
investigateinsrc/devops_cli/roadmap/refine/refine_investigation.pywith a fake model. - THEN The test asserts that the agent instructions contain the style text.
Existing Tool Considered
The alternatives check in the issue body records verdict none and Tool: none found. It found no covering tool. No open, maintained tool or library covers this need. The plan changes the project's own agent builders. Written cost: about 2,000 tokens to build, 1,000 to keep and 1,000 to fix; under one hour.
Key questions
- Where should the style request be added so that chat, investigate and implement-step agents all get it?: Add
with_style_requestin the sharedbuild_agentinsrc/devops_cli/ai/client/factory.py, and make the implement-step builder call that factory or apply the same helper. A new caller then cannot bypass the style request. (best practice) [sources: src/devops_cli/ai/client/factory.py:252, src/devops_cli/roadmap/implement/implement_step.py:767, src/devops_cli/roadmap/refine/refine_investigation.py:571, src/devops_cli/commands/ai.py]- Chosen: Shared helper used by both builders. Chat and investigate already call it, and one edit covers both paths.
- Rejected: Factory builder only. The implement-step builder is separate and would still bypass the style request.
- Rejected: Each call site. A new caller can bypass the style request again.
- Should the style request go into the agent instructions or into each user prompt?: Put it into the agent instructions. pydantic-ai sends the instructions on every run, so one edit covers all prompts and multi-turn runs. (best practice) [sources: src/devops_cli/ai/client/factory.py:252, src/devops_cli/ai/client/style_request.py:8, src/devops_cli/ai/tasks/style_ste100.md]
- Chosen: Agent instructions. It applies to every run and every turn with no caller action.
- Rejected: Each user prompt. A caller can forget it and it repeats in every turn.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both ensure the implement step agent receives rules it should follow, but #3097 adds AGENTS.md and routed docs while the candidate adds the ASD-STE100 style request to chat, investigate, and implement step runs.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: The searches returned no open tool or library that adds a project's style rules (ASD-STE100, bottom line first) to pydantic-ai agent runs; they only returned unrelated pages. The need is an internal fix in this repository: pass the style request in
build_agentand in theinvestigateand implement-step paths, so no external tool covers it.Tool: none found
Lacks:
src/devops_cli/ai/tasks/style_ste100.mdto every pydantic-ai agent run.with_style_request.build_agentand theinvestigatecallers), which no external library provides.Searches run:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 0581ec5 (see proposed design in issue body).
devops-cli-service commentedon Nov 28, 2026
The result in the alternatives block of the issue body changed. Before this check:
none, no tool. A person decides what the new result means for the item.Searches (7)
Tools considered:
Searches run:
Sources:
test(ai): cover sequence instructions in _styled_instructions (#5424)
fix(ai): attach style request to agent builders (#5424)
test(ai): cover sequence instructions in _styled_instructions (#5424)
chore(main): release 0.249.0 (#7769)
devops-cli-service commentedon Nov 29, 2026
Released in v0.249.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.249.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC