diff --git a/.agents/skills/triage/comment.md b/.agents/skills/triage/comment.md index 6f9f92388d78..36c3c6d4a3c6 100644 --- a/.agents/skills/triage/comment.md +++ b/.agents/skills/triage/comment.md @@ -25,30 +25,20 @@ If `report.md` is missing or empty, generate a minimal comment (see "Fallback" s ## Step 2: Generate Comment -Generate and return a GitHub comment following this template. Adapt it to fit the findings: +Generate and return a GitHub comment following the template below. -- Include only the sections that are relevant to what was discovered -- If the issue could NOT be reproduced, omit the fix-related sections -- If no fix was developed, omit the "How to Fix" section or replace its content with a brief note explaining why -- Add or remove subsections as needed to clearly communicate findings +### Special Cases -Keep it concise: - -- Summary section: One sentence per bold field -- Use collapsible `
` sections for longer content -- Include exact versions, commands, and file paths where relevant - -Format requirements: - -- Code blocks: Use appropriate language hints (bash, typescript, diff, patch, etc.) -- Patches: Use ```diff for maintainer patches +- **If the user is on a different major version than the current monorepo, and the issue could not be reproduced in the current monorepo:** In the "Fix" section of your comment, the best guidance you can provide is to suggest that the user upgrade to that newer major version to fix their issue, even if that newer major version is a beta release. Link to the relevant upgrade guide: + - v6: https://v6.docs.astro.build/en/guides/upgrade-to/v6/ + - v5: https://docs.astro.build/en/guides/upgrade-to/v5/ ### Template ```markdown **[I was able to reproduce this issue. / I was unable to reproduce this issue.]** [1-2 sentences describing the result and key observations.] -**Fix:** [If `branchName` arg is non-null, include: [Create PR](https://github.com/withastro/astro/compare/{branchName}?expand=1)] **[I was able to fix this issue. / I was unable to fix this issue.]** [1-2 sentences describing the solution and key observations. Even if no fix was created, you can still use this space to give guidance or "a best guess" at where the fix might be.] +**Fix:** [If `branchName` arg is non-null, include: [Create PR](https://github.com/withastro/astro/compare/{branchName}?expand=1)] **[I was able to fix this issue. / I was unable to fix this issue]** [1-2 sentences describing the solution and key observations. Even if no fix was created, you can still use this space to give guidance or "a best guess" at where the fix might be.] **Cause:** [Single sentence explaining the root cause - or just the word "Unknown" if not determined.] diff --git a/.agents/skills/triage/reproduce.md b/.agents/skills/triage/reproduce.md index 77b3ae925d49..22773fc5aa90 100644 --- a/.agents/skills/triage/reproduce.md +++ b/.agents/skills/triage/reproduce.md @@ -36,13 +36,34 @@ Once you have `bugDetails`, read carefully: Before attempting reproduction, check if this issue should be skipped due to a limitation of our sandbox reproduction environment. -If any condition below is met, skip to Step 6 and write `report.md` with the skip details. +If any early exit condition is met, skip to Step 6 and write `report.md` with the skip details. -- **Not actionable** — Issue is not a bug report (this workflow can only act to triage bugs, cannot handle feature requests, suggestions, etc.). → skip reason: `not-actionable` -- **Unsupported version** — Astro 4.x or earlier (check `astro info` output or package.json). → skip reason: `unsupported-version` -- **Unsupported runtime** — Bug is specific to Bun or Deno. → skip reason: `unsupported-runtime` -- **Host-specific** — Bug is specific to Vercel, Netlify, Cloudflare, etc. (check for runtime adapter usage). → skip reason: `host-specific` -- **Maintainer override** — A maintainer commented that this issue cannot be reproduced here. Check status: `gh api "repos///collaborators/" --silent && echo "user is collaborator"`. → skip reason: `maintainer-override` +**Comment Handling for Early Exits:** Sometimes future comments will provide additional reproductions. An early exit is only valid if not future comments in that issue "invalidate" it. For example, if the original poster of a bug was on Astro 3.0, we would exit initially (`unsupported-version`). However, on a future run, if a commenter had later posted a similar reproduction but on the latest version of Astro, we would no longer consider that a valid early exit, and would instead continue on with the workflow. + +The following are the documented early exit conditions that we support: + +### Not Actionable (`not-actionable`) + +Skip if the issue is not a bug report. This workflow can only triage bugs — feature requests, suggestions, and discussions are not actionable here. + +### Unsupported Astro Version (`unsupported-version`) + +Skip if the bug targets Astro 4.x or earlier. Look for version in `astro info` output or package.json mentions. + +### Host-Specific Issues (`host-specific`) + +Skip if the bug can only be reproduced on a specific hosting platform (Vercel, Netlify, Cloudflare, Deno Deploy, etc.). Signs to look for: + +- Issue references a host-specific adapter (`@astrojs/vercel`, `@astrojs/netlify`, `@astrojs/cloudflare`) +- Bug only occurs "in production" or "after deployment" but specifically not reproducible in dev and local preview builds + +### Runtime-Specific Issues (`unsupported-runtime`) + +Skip if the bug is specific to Bun or Deno. Our sandbox only supports Node.js. + +### Maintainer Override (`maintainer-override`) + +Skip if a repository maintainer has commented that this issue should not be reproduced here. Check collaborator status with: `gh api "repos///collaborators/" --silent && echo "user is collaborator"` ## Step 3: Set Up Reproduction Project @@ -62,7 +83,7 @@ Check the issue to determine what's needed: - MDX content → `pnpm astro add mdx` - Specific adapter → `pnpm astro add node` (or vercel, netlify, etc.) -## Step 4: Configure the Project +## Step 4: Configure the Triage Project Based on the issue, modify the triage project: @@ -72,32 +93,13 @@ Based on the issue, modify the triage project: Keep the reproduction as minimal as possible — only add what's needed to trigger the bug. -## Step 5: Attempt Reproduction - -Run commands to reproduce the issue: - -```bash -# For build-time issues -pnpm run build - -# For dev server issues -pnpm run dev -# Then use agent-browser to test: npx agent-browser http://localhost:4321/path - -# For preview issues -pnpm run build && pnpm run preview -``` - -Test both: - -1. **The broken case** — follow the steps to trigger the bug -2. **The working case** — verify the project works normally before the breaking change +## Step 5: Attempt Reproduction in the Triage Project -Document what you observe: +Use all of the tools at your disposal — `pnpm run dev|build|preview|test`, `curl`, `agent-browser`, etc. -- Exact error messages and stack traces -- Which command triggers the issue -- Whether the issue is consistent or intermittent +1. **Trigger the bug.** Follow the reproduction steps from the issue and confirm that the bug appears. +2. **Verify the baseline.** Remove or reverse the triggering code and confirm the project works without the bug. This guards against false positives — if the project is still broken without the triggering code, the issue may be in your setup, not the reported bug. +3. **Document what you observe.** Record exact error messages and stack traces, which command triggers the issue, and whether it's consistent or intermittent. ## Step 6: Write Output diff --git a/.flue/workflows/issue-triage.ts b/.flue/workflows/issue-triage.ts index 78422d644b6a..e7e190bba520 100644 --- a/.flue/workflows/issue-triage.ts +++ b/.flue/workflows/issue-triage.ts @@ -99,13 +99,17 @@ Return only "yes" or "no" inside the ---RESULT_START--- / ---RESULT_END--- block // - create a PR from that branch entirely in the GH UI // - ignore it completely if (fixResult.fixed) { + // Check if the fix skill left uncommitted changes in packages/ const status = await flue.shell('git status --porcelain'); + // TODO: Assert flue.branch if (status.stdout.trim()) { + await flue.shell(`git checkout -B ${flue.branch}`); await flue.shell('git add -A'); + // TODO: we should add comments to flue.shell internally, to find out why nothing happened. await flue.shell( `git commit -m ${JSON.stringify(fixResult.commitMessage ?? 'fix(auto-triage): automated fix')}`, ); - const pushResult = await flue.shell(`git push origin HEAD:refs/heads/${flue.branch}`); + const pushResult = await flue.shell(`git push -f origin ${flue.branch}`); console.info('push result:', pushResult); isPushed = pushResult.exitCode === 0; } diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index e12b3850b532..82484ec91d8a 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -6,6 +6,12 @@ on: issue_comment: types: [created] +concurrency: + # Only one triage run per issue at a time. New runs queue (not cancel) + # to avoid killing in-flight runs when the bot posts its own comment. + group: issue-triage-${{ github.event.issue.number }} + cancel-in-progress: false + jobs: triage: # 1. Skip old issues (only run on issues created after this workflow was created) @@ -44,7 +50,7 @@ jobs: echo "/home/runner/.opencode/bin" >> $GITHUB_PATH - name: Install agent-browser - run: pnpm install -g agent-browser --config.onlyBuiltDependencies='*' && agent-browser install + run: npm install -g agent-browser && agent-browser install - name: Install deps run: pnpm install --frozen-lockfile diff --git a/package.json b/package.json index 7d9d30dbc72c..6647e3c1d94c 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,8 @@ "@biomejs/biome": "2.3.6", "@changesets/changelog-github": "^0.5.2", "@changesets/cli": "^2.29.8", - "@flue/cli": "^0.0.17", - "@flue/client": "^0.0.9", + "@flue/cli": "^0.0.18", + "@flue/client": "^0.0.10", "@types/node": "^18.19.115", "esbuild": "0.25.5", "eslint": "^9.39.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d56a39442b57..be1b7697bd6e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,11 +25,11 @@ importers: specifier: ^2.29.8 version: 2.29.8(@types/node@18.19.130) '@flue/cli': - specifier: ^0.0.17 - version: 0.0.17(typescript@5.9.3) + specifier: ^0.0.18 + version: 0.0.18(typescript@5.9.3) '@flue/client': - specifier: ^0.0.9 - version: 0.0.9(typescript@5.9.3) + specifier: ^0.0.10 + version: 0.0.10(typescript@5.9.3) '@types/node': specifier: ^18.19.115 version: 18.19.130 @@ -8803,12 +8803,12 @@ packages: '@fastify/static@9.0.0': resolution: {integrity: sha512-r64H8Woe/vfilg5RTy7lwWlE8ZZcTrc3kebYFMEUBrMqlydhQyoiExQXdYAy2REVpST/G35+stAM8WYp1WGmMA==} - '@flue/cli@0.0.17': - resolution: {integrity: sha512-mkBo6SpeYwyH/eAlA80HcGdtPiAVZgdewi2e/BlA/+uL2dJ+CU8d3dpFsXtR00bvmRMJuzYfuZn7SQGNeHy4Bw==} + '@flue/cli@0.0.18': + resolution: {integrity: sha512-qulyJWYQ/idUs6bDSGZxP4jnQ9zrNwD/kKK0z2sElEUVx5OcwWmnlPJS7DbbQSBt25WelWu4rPZ11Ad4CXVuhQ==} hasBin: true - '@flue/client@0.0.9': - resolution: {integrity: sha512-gugVi8LNrlfiRAq84uPsiQCk5y23ToU2M1GJpsyRSS8zZ6Ho6HC2Id22Wsayyv/xtKAIh646Aktvn49OJV4wSA==} + '@flue/client@0.0.10': + resolution: {integrity: sha512-wtSd0h9SZyw3xkcyxrfp3wVeXMjmm/vD2oDQkT0SSYEunnSaq9G5zBTOzJWtTPgqpoKQumuF3Qc+C+rRZqb5vA==} '@fontsource/monofett@5.2.8': resolution: {integrity: sha512-cUtT8ScH3HHsMBkRrXFCrhGpKqRrKVNOhnYVSusECfB7g13YZjOrrLlhlc3o+R2IYpRrQQg/T/febSVD6k2Dhw==} @@ -18060,13 +18060,13 @@ snapshots: fastq: 1.19.1 glob: 13.0.1 - '@flue/cli@0.0.17(typescript@5.9.3)': + '@flue/cli@0.0.18(typescript@5.9.3)': dependencies: - '@flue/client': 0.0.9(typescript@5.9.3) + '@flue/client': 0.0.10(typescript@5.9.3) transitivePeerDependencies: - typescript - '@flue/client@0.0.9(typescript@5.9.3)': + '@flue/client@0.0.10(typescript@5.9.3)': dependencies: '@opencode-ai/sdk': 1.1.56 '@valibot/to-json-schema': 1.5.0(valibot@1.2.0(typescript@5.9.3))