Skip to content

Website build error#1136

Merged
aaronpowell merged 4 commits into
stagedfrom
website-build-error
Mar 23, 2026
Merged

Website build error#1136
aaronpowell merged 4 commits into
stagedfrom
website-build-error

Conversation

@aaronpowell
Copy link
Copy Markdown
Contributor

Build error on website as we didn't handle when model is an array

Copilot AI review requested due to automatic review settings March 23, 2026 04:54
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This PR targets main, but PRs should target staged.

The main branch is auto-published from staged and should not receive direct PRs.
Please close this PR and re-open it against the staged branch.

You can change the base branch using the Edit button at the top of this PR,
or run: gh pr edit 1136 --base staged

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the website build failure caused by agent frontmatter using model as an array (instead of a single string), so the Agents page can render and filter safely.

Changes:

  • Update escapeHtml (and agent page types) to accept model as string | string[] and render arrays safely.
  • Update Agents page model filtering logic to support item.model as an array.
  • Adjust Astro/Vite build settings (sourcemaps + chunk warning threshold), and update one agent to use a multi-model model list.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/src/scripts/utils.ts Makes escapeHtml handle string[] so SSR rendering won’t crash when model is an array.
website/src/scripts/pages/agents.ts Updates model typing and filtering to handle array-valued models.
website/src/scripts/pages/agents-render.ts Updates RenderableAgent.model typing to allow arrays.
website/astro.config.mjs Changes Vite build settings (sourcemap + chunk warning limit).
agents/dotnet-self-learning-architect.agent.md Switches model frontmatter to an array and reformats content.
Comments suppressed due to low confidence (1)

website/src/scripts/pages/agents.ts:54

  • The model filtering logic will still behave incorrectly when an agent's model is an array because the generated agents.json filter list currently collects model values as-is. That means filters.models will contain the entire array as a single option (stringified like "a,b,c"), and selecting it will never match here because this predicate checks for individual model entries. Please normalize models so filters contain individual strings (flatten arrays during data generation, or defensively split/flatten filter values before comparison).
      return item.model && (Array.isArray(item.model) ? item.model.some(m => currentFilters.models.includes(m)) : currentFilters.models.includes(item.model));

return true;
}
return item.model && currentFilters.models.includes(item.model);
return item.model && (Array.isArray(item.model) ? item.model.some(m => currentFilters.models.includes(m)) : currentFilters.models.includes(item.model));
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline conditional is difficult to read and maintain, and it duplicates the concept of “normalize model(s) to a list then match any”. Consider extracting a small helper (e.g., normalize to string[] once per item) to keep the filter predicate clearer and easier to extend.

This issue also appears on line 54 of the same file.

Copilot uses AI. Check for mistakes.
Comment thread website/astro.config.mjs
Comment on lines +118 to +123
// Production sourcemaps trigger a known warning in the expressive-code Vite plugin.
// The docs site does not need emitted JS sourcemaps for its validation build.
sourcemap: false,
// Starlight ships large syntax-highlighting chunks that are expected for this site.
// Raise the threshold so Vite only warns on materially larger regressions.
chunkSizeWarningLimit: 900,
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes build output behavior (disables sourcemaps and raises chunkSizeWarningLimit) but the PR description only mentions handling model as an array. Please either (1) update the PR description to justify these Vite config changes, or (2) split them into a separate PR so the website build fix can be reviewed independently.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +38
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0 # Full history needed for git-based last updated dates

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
cache: "npm"

- name: Install root dependencies
run: npm ci

- name: Install website dependencies
run: npm ci
working-directory: ./website

- name: Build Astro site
run: npm run website:build
@aaronpowell aaronpowell changed the base branch from main to staged March 23, 2026 05:04
@aaronpowell aaronpowell merged commit 5621850 into staged Mar 23, 2026
11 checks passed
@aaronpowell aaronpowell deleted the website-build-error branch March 23, 2026 05:04
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.

3 participants