Skip to content

feat(site/src): show agent definition warnings in the context popup - #137

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/custom-agent-types-r1-4-context-popup-warnings
Nov 10, 2026
Merged

ibetitsmike merged 4 commits into
mainfrom
mike/custom-agent-types-r1-4-context-popup-warnings

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #7

With fork-agent-definitions on, the context popup now shows the workspace's agent definition files and their problems (brief item 5 and PRD R1.4). Before this change, #83 sent these files through the chat context API as subagent resources, but the popup rendered none of them. A broken definition only turned the indicator's warning tone on, and an OK definition's parse warnings, such as an unknown front-matter field, never appeared. This was item 5 of #75; W10 is paused, so it moved here.

Change

  • ContextUsageIndicator gets an "Agent definitions" section after ACP. It lists each OK definition by name, grouped by directory, with its description as the tooltip and its warnings below the row. Definitions the agent could not use (invalid, oversize, unreadable) appear as issues with their status and error, like skill issues.
  • The section's issue badge counts both kinds. Warnings on an OK definition also turn on the indicator's warning tone and add "Some agent definitions have warnings." to its accessible name, so the popup is worth opening.
  • With the experiment off, the server sends no subagent rows (Server.ContextResources), so the popup is unchanged.

Tests

  • Vitest (ContextUsageIndicator.test.tsx): the section's accessible name reports 2 issues, and expanding it shows the joined warnings of an OK definition and the error of an invalid one. A second test checks that warnings alone add the status note to the trigger.
  • Story ContextUsageIndicator/AgentDefinitions covers the expanded section.
  • Negative controls, each restored: not rendering the warnings, not counting them in the badge, not rendering the issues, and dropping the status note. Each turns a test red.
  • Ran: biome and oxlint on the touched files, pnpm run lint (tsc, dpdm, compiler check, knip), and biome format .. frontend-deep-review found no remaining blocking or should-fix findings. The Vitest test that asserts rendered text is a deliberate exception that the project lead asked for.

Size

About 180 changed lines: about 90 in the component, about 50 in fixtures, about 45 in tests and the story.

With fork-agent-definitions on, the chat context API reports each agent
definition file as a subagent resource, with its parse warnings in the
OK row's error. The context popup did not render these rows. It now lists
OK definitions under "Agent definitions" with their warnings, and the
definitions the agent could not use as issues.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T12:05:11.506290Z a751216 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0fb2a23bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/testHelpers/chatEntities.ts Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

UAT: PASS on head e0fb2a23bf3501101122dc3ecebd1b2984c7d887. This PR's frontend ran in Vite on 127.0.0.1:8080, proxied to the 3100 test server (v2.39.0-devel+17ef3432d9). The browser was Playwright Chromium, signed in as member uatw1.

The workspace's ~/.coder/agents/ held three definitions:

  • comment-sicko.md from pstack, which is OK.
  • warn.md, which is OK but carries the unknown key temperature.
  • Broken.md, which is invalid because of its name.

Results:

  • The trigger has the warning tone. Its aria-label ends with Some context resources failed to load. Some agent definitions have warnings.
  • The Agent definitions section shows 2 available, grouped under /home/coder/.coder/agents: comment-sicko, and warn-uat with unknown front-matter field "temperature" ignored in the warning color. Issues lists Broken.md (agent definition: invalid) with agent name "Broken Name!" is not kebab-case.
  • The same chat spawned comment-sicko by type. The evidence is on pstack W1: custom agent types #7: pstack W1: custom agent types #7 (comment)
  • The browser console's only errors were the Vite proxy's cross-origin latency-check request. That comes from the dev setup, and this PR doesn't touch it.

Context popup with the Agent definitions section

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: a751216e0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 5a47dc7 into main Nov 10, 2026
9 checks passed
@ibetitsmike
ibetitsmike deleted the mike/custom-agent-types-r1-4-context-popup-warnings branch November 10, 2026 12:18
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head a751216e0df5a59013641d5306c6e085e3178d88 (frontend only, 4 site files):

  • fork-ci pull_request run 42812168141 passed; its build job checked out Merge a751216e0d into b4dfdb922c (current main). All 9 checks green.
  • Codex on this exact head: no major issues (comment 6766839133). 0 unresolved review threads; 2 findings fixed, 3 declined with reasons in the replies.
  • UAT PASS on 3100 at 17ef3432d9 with this PR's frontend at e0fb2a23bf (comment 6766727663): the context popup lists each agent definition issue and warning, and the indicator shows its warning tone. Accepted as covering this head: e0fb2a23bf..a751216e0d changes one comment, one test fixture string and the matching test expectation, with no runtime code.
  • frontend-deep-review: no blocking or should-fix findings.

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