Skip to content

Implement deterministic binary for collecting and structuring PR data as agent input #6407

Open

Description

@fullsend-ai-triage

Note

This issue was automatically generated from meeting notes by the scribe agent.
Please review, edit, and add any missing context before prioritizing.

Problem

Agents currently gather PR context (diff, comments, CI status, review history) through ad-hoc tool calls during their runs. This is non-deterministic, wastes tokens on API calls that could be pre-computed, and makes agent behavior harder to reproduce or debug. Each agent independently collects overlapping data with no shared format.

Options considered

  • Deterministic binary/script: A pre-run binary collects all PR data, comments, CI status, and review history into structured files that agents consume as input. This separates data collection from agent reasoning, reducing token usage and improving reproducibility.
  • Enhanced pre-scripts per agent: Extend existing per-agent pre-scripts (pre-review.sh, pre-fix.sh) to fetch more context. Simpler but duplicates logic across agents and does not standardize the format.
  • Shared library approach: A Go package in the CLI that agents call via a tool, returning structured data. Still happens during the run but is at least standardized.

Acceptance criteria

  • A binary or script collects PR diff, comments, reviews, CI status, and metadata into structured files
  • Output files use a documented, stable format consumable by all agents
  • Collection is deterministic — same PR state produces identical output files
  • Fix, review, and code agents can consume pre-collected data instead of making ad-hoc API calls
  • Token usage for context gathering is measurably reduced compared to current ad-hoc collection

Related

Activity

  1. fullsend-ai-prioritize commented on Aug 26, 2026

    @fullsend-ai-prioritize

    RICE Priority Score: 0.9

    Score breakdown
    Dimension Score Reasoning
    Reach 2 This affects all agents that operate on PRs (fix, review, and code agents), which are core platform features used by most active users across orgs. The issue explicitly names three agent types that would consume the pre-collected data, and token savings would benefit every user triggering those agents.
    Impact 1.5 Significant efficiency gain: reduces token waste on redundant API calls, improves agent reproducibility and debuggability, and standardizes context collection across agents. However, the current ad-hoc approach works — this is an optimization, not a fix for broken functionality. Related issue #5367 suggests token waste is a known pain point.
    Confidence 0.6 The issue has clear acceptance criteria and discusses multiple options considered, indicating real team deliberation. However, it was auto-generated from meeting notes with no subsequent comments, labels, or milestone assignment, leaving gaps around exact scope, chosen approach, and actual token savings. Effort is uncertain since it touches multiple agents and requires a stable format contract.
    Effort 2 Complex implementation: requires building a new binary/script, designing a documented stable output format, ensuring determinism, and updating at least three agents (fix, review, code) to consume the new format. Extends prior work (#3472, #4207) which helps, but coordination across agents and defining a stable contract adds significant scope.

    Formula: (2 x 1.5 x 0.6) / 2 = 0.9

  2. maruiz93 commented on Sep 2, 2026

    @maruiz93
    Contributor

    /fs-triage shouldn't this happen as part of the pre-script instead of a binary? We could even have both but I don't see the reason of this happening in the agent instead of in the pre-script phase

  3. fullsend-ai-triage commented on Sep 2, 2026

    @fullsend-ai-triage
    Author

    🤖 Finished Triage · ✅ Success · Started 3:43 PM UTC · Completed 3:48 PM UTC

    Commit: 7495cdc · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.91

  4. added
    feature
    triaged
    type/feature
    component/harness
    component/runner
    priority/medium
    on Sep 2, 2026
  5. fullsend-ai-triage commented on Sep 2, 2026

    @fullsend-ai-triage
    Author

    Triage assessment

    Severity: medium · Category: feature

    The design question raised by the contributor — pre-script vs standalone binary — is a key decision point before implementation starts. The issue body already discusses both approaches with trade-offs. The acceptance criteria are approach-agnostic, so either path could satisfy them. Flagging with needs-design so the team can align on the approach before coding begins.

    Related work

    Several open issues track retro-agent pre-fetch patterns that this work would generalize:

    These are not prerequisites (this issue can proceed independently) but the patterns established there should inform the design.

    Proposed test case

    1. Run the collection step twice against the same PR state
       → Assert output files are byte-identical (determinism)
    2. Run an agent with pre-collected files available
       → Assert zero ad-hoc PR context API calls during the run
    3. Compare token usage of an agent run with vs without pre-collection
       → Assert measurable reduction in context-gathering tokens
    

    Labels: Feature request for cross-agent PR context pre-collection — touches harness/runner architecture, affects fix/review/code agents, and needs a design decision on approach before implementation.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  6. self-assigned this
    on Sep 7, 2026
  7. fullsend-ai-scribe commented on Sep 7, 2026

    @fullsend-ai-scribe

    Meeting update — 2026-09-07

    Relevant to this issue: The team discussed building a client-side vector database at build time to enable efficient semantic search for agents, directly supporting this issue's goal of pre-computing structured PR context as agent input.

    • Proposed generating a client-side vector database at build time for semantic search across documentation
    • Using file reads instead of API calls for local context access is expected to reduce token usage and improve performance
    • Documentation is being converted to Markdown format to improve agent accessibility
    • These approaches align with the deterministic data collection and pre-computation goals of this issue

    Related PRs: #7080 (ADR: adopt deterministic entity context staging)

    Next steps: Continue work on the entity context staging approach captured in the in-flight ADR.

    Meeting notes

  8. 51 remaining items

  9. added 14 commits that reference this issue on Oct 14, 2026
  10. added a commit that references this issue on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component/harnesscomponent/runnerfeatureneeds-designpriority/mediumtriagedtype/feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions