Repository navigation
Inject current Auto Review awareness into agent context #62
Description
Current Status
State: Partially implemented. PR #77 merged the model-context awareness slice, and PR #78 fixed the follow-up foreground-turn registration race found by Auto Review.
- Added a bounded
AutoReviewAwarenessContextualUserFragmentregistered in native Codex context filtering. - Injects request-only Auto Review awareness late in normal model input, refreshed per sampling request, without persisting the volatile fragment to conversation history.
- Includes live pending/running run ids, current finding summaries, stale/detached/status counts, and stable
run_id/finding_idreferences. - Excludes full finding bodies, diffs, logs, and raw JSON from normal turns.
- Freshness/target gates current findings and chooses the newest current run deterministically.
- Strengthened exec-harness cache coverage with structural
input_prefix_matches_requestand validatedskills-cache-continuity. - Follow-up PR Register background review turns before fingerprinting #78 registers foreground turns before async fingerprinting, closing the stale/overlap scheduling race reported by Auto Review after Inject Auto Review awareness into turn context #77.
Still remaining before this issue can close:
- Provide a native bounded detail retrieval surface by stable
run_id/finding_idwhen the agent/tooling needs more context than the normal awareness summary. - Decide whether that retrieval is exposed as a core tool, an app-server method, or both; prefer the smallest native surface that supports Expose native Auto Review findings in app-server and TUI #57.
- Add targeted tests for detail lookup success, unknown run/finding ids, non-current/stale handling if applicable, and payload caps.
Validation already completed for the merged awareness slice:
- Local focused Rust tests, CLI build, exec-harness unit tests, black-box
skills-cache-continuity,just fmt, andgit diff --check. - GitHub checks passed on Inject Auto Review awareness into turn context #77 and Register background review turns before fingerprinting #78: build-test, cargo-deny, codespell, macOS app build, and Codex exec harness.
Recommended next action: implement the bounded detail retrieval slice, then update/close #62 or hand the shared summary/detail primitives to #57 for app-server/TUI surfacing.
Finish Line
Codex injects a small, current Auto Review awareness fragment into the agent's model context so the agent knows whether a relevant review is pending, running, stale/superseded, or completed with findings, and can retrieve bounded detail by run/finding id when needed.
Acceptance Criteria
- Define a
core/contextfragment struct for Auto Review awareness that implementsContextualUserFragment. - Include live status for relevant pending/running review work, not only completed findings.
- Inject only target-matched status/finding metadata; stale, detached, failed, cancelled, or superseded runs should be represented as bounded status when relevant, but must not surface stale findings as current.
- Keep the injected fragment bounded with hard caps under the repo's model-visible-context rules, including no individual item over 10K tokens and a practical MVP cap around a few KB.
- Include stable run/finding IDs, lifecycle status, freshness status, short severity/category/title/location summaries, and enough metadata for the agent to know whether detail is available.
- Do not inject full finding bodies, long explanations, diffs, logs, or raw review JSON into normal turns.
- Provide a native way for the agent/tooling to retrieve bounded finding details by run/finding id when more context is needed.
- Preserve prompt-cache friendliness by keeping stable prompt content ahead of volatile Auto Review status and avoiding needless context churn when the current awareness packet has not changed.
- Add tests proving running status appears, current findings appear, stale/superseded status is visible without stale findings being treated as current, oversized payloads are truncated with clear markers, and no context is injected when storage is missing or unreadable.
Open Questions
- Should awareness be injected into all user turns, only coding turns, or only after a background review has new current findings?
- Should clean reviews inject a tiny “current review found no findings” marker, or should clean state stay silent by default?
- Should detail retrieval be an app-server method, a core tool, or both?
Relationships
Child of #53. Blocked by #56 and #61. Related to #57 because app-server/TUI surfacing may share the same bounded summary and detail primitives.
Activity
shiny-code-bot commentedon Jun 14, 2026
Completed by PRs #77, #78, and #79.
Final state:
review/findingDetail/read, scoped to visible current target findings byrunId/findingId.Validation for the final detail retrieval slice passed locally and in GitHub checks on PR #79.