Repository navigation
Description
Summary
Found in the release/v0.2.23 review (line numbers at 7fdaa9d).
-
Agents keep memory across calls that should be independent.
message_history=[]is documented as "sends only the current prompt" (src/devops_cli/ai/agents/pipeline.py:136-137). In practice the agent still:- writes every prompt into memory;
- runs an LLM summarization once memory passes 96k characters;
- injects a "Prior Interaction & Memory Summary" into the system prompt.
The references are
src/devops_cli/ai/agents/agent.py:629-636,:816-818and:991-992. The review pipeline reuses cached persona agents across files it reviews concurrently (src/devops_cli/ai/review/pipeline.py:905). After about five pages:- every page pays for an extra summarization call over earlier files' code;
- each file is reviewed with a summary of other files in its prompt;
- the shared memory list is mutated without a lock.
-
Reasoning models get the wrong token cap field. The review completion cap always sends
max_tokens(8192) to models missing from the reasoning list, such asgpt-5andgpt-5-mini, and drops a configuredreasoning_effort(src/devops_cli/ai/client/openai.py:78-83,:112-116). Withprovider=openaiandmodel=gpt-5, the API is expected to rejectmax_tokensand ask formax_completion_tokens(API behaviour unconfirmed). Matching fordeepseek-r1andqwqalso changed from substring to prefix, so names likevendor/deepseek-r1are no longer recognised. -
Delta metrics can arrive out of order (unconfirmed). Counters and histograms are exported as 1 ns deltas, one HTTP POST each through a 2-worker pool, under a host-wide
service.instance.id(src/devops_cli/telemetry/tracer.py:564-566,:689-692,:982). Parallel LLM calls, or two processes on one host, can deliver points for the same stream out of order. The collector'sdeltatocumulativeprocessor (k8s/otel/values.yaml:61) drops those points, so request, token and spend totals undercount.
Remediation Plan
- When the caller passes
message_history=[], skip memory writes, summarization and summary injection. Keep per-run state out of shared cached agents, or give each file its own agent. - Send
max_completion_tokensandreasoning_effortfor OpenAI reasoning families, matched by family prefix or substring includinggpt-5*, and restore substring matching fordeepseek-r1andqwq. - Confirm the metric ordering against a local collector. If it reproduces, give each process a unique
service.instance.idand export cumulative temporality, or serialize exports per stream. - Add tests for each change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(review): remediate response repair, review pipeline and verifier …