GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — refactor(site/src/pages/AgentsPage): extract SkillEditorForm and shared skill helpers by jaaydenh · Pull Request #30854 · coder/coder Conversation
|
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: a14b4950d4
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
… focusable and cover submit settlement
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…the project skills failure comment
A transient project skills failure leaves the list unknown again, so a project skill named clear or compact keeps precedence over the built-in command. The page query retries those failures.
Every observer of the project skills query now shares its retry policy, and a 403 or 404 after an earlier load also counts as no project skills.
…st access after project skills loaded
…skill-editor-form-retarget
chatd loads project skills only when the chat owner owns the project or it is shared with them, while the skills list endpoint also honors role grants. The page and the composer now also consult the caller's project list, which holds only owned and shared projects, and keep project skills unknown while that list is unsettled. The composer tests mock the project list, seed caches with the exported chatProjectSkillsKey, and wait on query state instead of DOM absence.
…il refetched A cached list can predate a share's revocation as well as its creation, so a project it contains is no more current than one it lacks.
| nameHint = "Use lowercase letters, numbers, and hyphens. Names cannot be changed after creation.", | ||
| bodyPlaceholder = "Describe when and how agents should use this skill.", | ||
| header, | ||
| footer, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The prop slop is hurting my brain here 🥲
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Split into compound components in #31122, at the end of the stack. #30855 and #30884 reshape this API (the project dialog's Back header, the project settings switches), so I did it once there instead of reworking each layer. SkillEditorForm is now a root plus named parts (SkillEditorNameField, SkillEditorImport, SkillEditorSubmitButton, ...) and a useSkillEditorFormState() hook; the render-prop slots, copy overrides, and Omit<> are gone.
Does landing it right after #30884 work for you, or would you rather have it before this PR merges? If so, I'll move the refactor down to this PR and merge it up the stack.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preapproving assuming we turn this into compound components. Code is fine otherwise 🙂
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Turns check project access once with resolveUsableChatProjectID and then load instructions and skills, so resolveProjectInstructions had no production callers. Its tests now cover resolveUsableChatProjectID and loadProjectInstructions directly.
…coder into chat-project-skills/chatd
…retry prompt for unusable projects A 403 or 404 from the project skills request means the caller lost access to the project, which the composer already treats as no project skills. The slash menu still showed "Could not load project skills" with a retry hint that could never succeed, so a project the caller cannot use no longer shows a loading or error status. A story covers the menu in that state.
Chats that belong to a chat project now get the project's skills, next to personal, organization and workspace skills. They show up in the model's skill list, load through `read_skill`, and appear in a "Project skills" group in the `/` menu. - `coderd/x/skills` adds the `project` source. `MergeSkills` now takes a list of sources in merge order (personal, organization, project, workspace). Bare names stay bare unless two sources share a name, in which case they get `project/<name>` style aliases. - chatd loads project skills only when the chat owner owns the project or the project is shared with them. Role grants don't count. This is the same `usableChatProject` check that project instructions and memory use, and one check per turn covers both instructions and skills. Disabled skills are skipped. A failed load logs a warning and the turn continues without them. Subagents use their root chat's project; that lookup is now a helper shared with project instructions. - The site loads project skills for the composer on the project page and in project chats, behind the `chat-projects` experiment. `/clear` and `/compact` defer to a project skill with the same name, as they already do for other sources. When the user can't use the project, the site treats it as no project skills, like chatd, so those commands keep working and the `/` menu shows no retry prompt for project skills. That covers a 403 or 404 from the project skills request and a project missing from the user's project list, which holds only owned and shared projects, so an administrator role that can read the project doesn't count. Other failures are retried and leave the list unknown. A cached project list is also unknown while it refetches or after a failed refetch, so a share revoked since it was cached keeps those commands pending instead of deferring to stale project skills. - Docs gain a "Project skills" section in the extending agents page. `coderd/x/chatd/ARCHITECTURE.md` gains a paragraph on project skills. Dogfood UAT on this branch passed: project skills appear in the project page `/` menu and in project chats, `read_skill` loads them, disabled and deleted skills report not found, chats outside the project don't see them, and a subagent gets them through its root chat. The site reads project skills from the chat's own `project_id`, so subagent chats show them in the composer once sub-chats carry their root's project (#30683). | Project page `/` menu | `read_skill` in a project chat | | --- | --- | | <img alt="Project skills group in the project page slash menu" src="https://raw.githubusercontent.com/coder/coder/assets/pr-30838-project-skills/pr/project-page-slash-menu.png" width="600" /> | <img alt="read_skill loading a project skill in a project chat" src="https://raw.githubusercontent.com/coder/coder/assets/pr-30838-project-skills/pr/project-chat-read-skill.png" width="600" /> | Stack (merge top to bottom): - #30838 👈 - #30854 - #30855 - #30856 - #30861 - #30880 - #30881 - #30882 - #30884 - #31122
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.