Skip to content

feat(agents): Update one stale example per workflow run - #13714

Closed
anthonyshew wants to merge 1 commit into
mainfrom
eve-per-example-workflows
Closed

anthonyshew wants to merge 1 commit into
mainfrom
eve-per-example-workflows

Conversation

@anthonyshew

@anthonyshew anthonyshew commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

The examples agent read "update our examples" as one run that walks all of examples/. This splits that into dispatch work and update work: a fan-out run picks the stale examples, and each one gets its own child run and its own pull request.

  • find_stale_examples (new tool). Reads the last commit for every examples/<name> from the GitHub API and marks an example stale after a week without a commit (staleAfterDays, default 7). It also inspects open pull requests and attributes each one to the example directories it touches, so anything already covered comes back under skipped with reason open-pull-request instead of in updateQueue. The queue is sorted oldest-first, and the other skip reasons (updated-recently, unknown-history) are reported too, so nothing disappears silently.
  • Workflow tool enabled. agent/tools/workflow.ts re-exports the ExperimentalWorkflow opt-in marker. A broad update request now becomes one tools.agent call per queued example, each scoped to a single example and a single pull request on agents/examples/<example>.
  • agent/lib/github.ts (new). The GitHub App JWT, installation-token cache, and request helper moved out of create_pull_request so both tools share them, plus the open-pull-request, pull-request-files, and last-commit-for-path queries the new tool needs. create_pull_request keeps its existing behavior.
  • Guidance rewritten. instructions.md and the examples_maintenance skill now describe the two roles: a fan-out run dispatches and reports, a single-example run updates one example and opens one pull request. The weekly audit stays read-only but starts from the same queue.

The fan-out uses the built-in agent tool rather than a declared subagent on purpose: children of agent share the parent's sandbox and tool surface, which create_pull_request depends on when it reads the edited files back out of the sandbox. A declared subagent would get its own sandbox and would need every tool re-declared under it.

Repository resolution for the new tool takes owner/repo inputs and falls back to GITHUB_REPOSITORY; it throws a clear error when neither is available.

Testing Instructions

  • pnpm exec tsgo in apps/agents (passes)
  • pnpm exec oxlint apps/agents/agent/ and pnpm exec oxfmt --check apps/agents/agent/ (clean)
  • pnpm exec eve build in apps/agents builds with 0 diagnostics; the compiled manifest reports workflowEnabled: true and lists find_stale_examples among the discovered tools.
  • The three GitHub endpoints the tool relies on were verified against vercel/turborepo (commits by path, open pull requests, pull-request files) and match the response shapes the code parses.

🤖 Generated with Claude Code

The examples agent treated "update our examples" as a single run over
every example. Split that into dispatch work and update work:

- Add `find_stale_examples`, which reads each `examples/<name>` commit
  date from GitHub and marks an example stale after a week without a
  commit. Examples touched by an open pull request are reported as
  skipped so the agent never opens a duplicate.
- Enable the experimental `Workflow` tool so a broad request fans out
  one child run per queued example, each opening a single pull request
  on `agents/examples/<example>`.
- Move the GitHub App auth and request plumbing out of
  `create_pull_request` into `agent/lib/github.ts`, and add the pull
  request, pull request file, and commit queries the new tool needs.
- Rewrite the instructions, the maintenance skill, and the weekly audit
  prompt around the per-example contract.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Co-Authored-By: Anthony Shew <35677084+anthonyshew@users.noreply.github.com>
@anthonyshew
anthonyshew requested review from a team and tknickman August 11, 2026 14:36
@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview Aug 11, 2026 2:38pm
examples-designsystem-docs Ready Ready Preview Aug 11, 2026 2:38pm
examples-gatsby-web Ready Ready Preview Aug 11, 2026 2:38pm
examples-kitchensink-blog Ready Ready Preview Aug 11, 2026 2:38pm
examples-nonmonorepo Ready Ready Preview Aug 11, 2026 2:38pm
examples-svelte-web Ready Ready Preview Aug 11, 2026 2:38pm
examples-tailwind-web Ready Ready Preview Aug 11, 2026 2:38pm
examples-vite-web Ready Ready Preview Aug 11, 2026 2:38pm
turbo-site Ready Ready Preview Aug 11, 2026 2:38pm
turborepo-eve-agent Error Error Aug 11, 2026 2:38pm

anthonyshew added a commit that referenced this pull request Aug 11, 2026
## Summary

- Replace the broad weekly examples run with one deterministic example
per day at 14:00 UTC.
- Select from the current sorted example list using the Eve session
date, so runs are stateless and cannot change targets across UTC
midnight.
- Enforce the selected example across audits, reads, writes, installs,
validation, and automated PR publication.
- Create focused branches and draft PRs named for the selected example
and date.
- Add dashboard example selection, defaulted to that day’s rotation, for
focused manual runs.
- Run the agent with the latest Moonshot model,
`moonshotai/kimi-k3-fast`.

This supersedes #13714 with the simpler stateless rotation requested in
review.

## Verification

- `fnm exec --using=24 pnpm check-types`
- `fnm exec --using=24 pnpm build`
- `eve info` reports zero diagnostics, daily cron discovery, and the
`select_daily_example` tool.
- Verified consecutive UTC dates select consecutive entries for a stable
sorted list.
- Pre-push formatting and TOML checks.

This branch had an error being deployed

1 failed deployment
Preview – turborepo-eve-agent — 36340ab4 Deployed Aug 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant