Skip to content

Move the review agent's AI calls to the internal agents gateway and turn on agent tracing #23

Description

@bryanfawcett

The review agent in worker/ is internal tooling: it only acts on Nyuchi's own allowlisted repositories, and only Nyuchi team members can summon it. Move internal AI to the internal agents gateway (fundi), not the gateway reserved for consumer-facing Shamwari chat.

Scope:

  • Route env.AI.run through fundi (AI_GATEWAY_ID), cache off, with metadata attribution (worker, job, repository, trigger kind) and no content or user identifiers.
  • No gateway guardrails on this path.
  • Keep the model a var so it can point at a gateway dynamic route (dynamic/review) without a code change.
  • Cut waste: do not call the model at all when the commit already carries a review (webhook redelivery / re-request), instead of reviewing and then discarding the result.
  • Enable Workers tracing (observability.traces.enabled = true, 100% sampling) and instrument the review turn with metadata-only agent spans (invoke_agent / chat, no prompts, diffs or responses).
  • Validate (type check, tests, wrangler deploy --dry-run), merge, confirm the deploy, confirm traffic on the new gateway.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions