Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
This repository was archived by the owner on Oct 9, 2026. It is now read-only.

Inject current Auto Review awareness into agent context #62

Closed

Description

@shiny-code-bot

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.

Completed by #77/#78:

  • Added a bounded AutoReviewAwareness ContextualUserFragment registered 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_id references.
  • 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_request and validated skills-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_id when 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:

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/context fragment struct for Auto Review awareness that implements ContextualUserFragment.
  • 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

  1. shiny-code-bot commented on Jun 14, 2026

    @shiny-code-bot
    CollaboratorAuthor

    Completed by PRs #77, #78, and #79.

    Final state:

    • Model-context Auto Review awareness is injected as a bounded request-only fragment.
    • Foreground/background scheduling races from the first awareness slice were fixed.
    • Stable bounded detail retrieval now exists through review/findingDetail/read, scoped to visible current target findings by runId / findingId.
    • Cache-safety concerns were covered by exec-harness prefix assertions and by moving Auto Review fingerprinting off the foreground turn hot path.

    Validation for the final detail retrieval slice passed locally and in GitHub checks on PR #79.

  2. added
    plan:donePlan completed or superseded
    and removed
    plan:activePlan is actionable now
    on Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    planDurable planning issueplan:donePlan completed or superseded

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions