Repository navigation
refactor(site/src): scope agent definition queries to a user or organization tier - #158
Conversation
Carry the organization in toggle and delete variables so a request that settles after an organization switch releases and invalidates its own list, reconcile the list after a failed delete, fall back to the table when the last row's menu button is gone, and describe deletion as removing only the personal definition.
A toggle or delete the server accepted stays visible even if the reconciling refetch fails.
…ion is gone A delete whose response was lost can still have committed, so the refetched list decides whether the dialog closes.
Keep the model and the other front-matter in the dialog and give the skill form a content builder, so the size limit, the meter, and the submitted markdown all use the agent definition file. Block Escape while a save runs, keep standalone front-matter comments, describe the field for agents, document the exported context hook, and test import and submit.
…ly bodies The size limit counts the model, which lives outside the skill form, so a model change validates again. The server strips HTML comments before it requires a body, so the form does too. The dialog now submits the name with the content.
…ent-definitions-ui-4-editor-wiring
…itions A create whose response was lost closes the editor when the refetched list shows the new name and the name was not listed before. Reopening a definition seeds the editor from cached data instead of waiting for the refetch. Tighten the API and query JSDoc.
…ssals, and indented comments The editor keeps the values it opened with as every field's baseline, so refreshed initial values cannot reset some fields and leave others stale. Escape and outside clicks act as Cancel, which the form disables from the moment Save is clicked. Indented front-matter comments after owned keys are kept unless they sit inside that key's block or quoted text. Add stories for the submitting and import error states.
…s-ui-3-editor-dialog
…or-dialog' into mike/agent-definitions-ui-4-editor-wiring
A save writes its response to the definition's cached detail, so a reopened editor shows the saved content even if the refetch fails. Cached content seeds the editor only when it matches the listed definition's id and is at least as new, or a fetch just returned it, so a definition recreated or edited elsewhere waits for its fetch.
Hand-classifying front-matter lines lost inline comments on owned keys and produced invalid YAML for indented root keys. Parse the front-matter as a yaml Document and set the owned keys in place, which keeps comments and other keys.
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
…Page): expect YAML document output
…m:ibetitsmike/coder into mike/agent-definitions-ui-4-editor-wiring
… newer cached definitions
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfea938c9f
ℹ️ 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".
…ionsPage): document the editor hook contract
…or-wiring' into mike/agent-definitions-ui-6-tier-scope # Conflicts: # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/useForkAgentDefinitionEditor.ts
|
@codex review
|
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour 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". |
…s-ui-4-editor-wiring # Conflicts: # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionEditorDialog.stories.tsx # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionEditorDialog.tsx
…s-ui-6-tier-scope # Conflicts: # site/src/api/forkAgentDefinitions.ts # site/src/api/queries/forkAgentDefinitions.test.ts # site/src/api/queries/forkAgentDefinitions.ts # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionsPage.test.tsx # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/ForkAgentDefinitionsTable.tsx # site/src/pages/AgentsPage/AgentSettingsPage/ForkAgentDefinitionsPage/useForkAgentDefinitionEditor.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ef77ed3db
ℹ️ 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".
|
@codex review
|
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour 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". |
Closing and reopening only to make GitHub recompute the merge ref against current main ( |
The merge ref now points at current main ( |
Merge evidence for head
|
Part of #75.
Prepares the organization agent definitions page by scoping the personal page's data layer to a tier:
AgentDefinitionScope({ tier: "user" | "organization", organizationId }) replaces the organization ID in the agent definition query options, query keys, and mutation variables.agentDefinitions,agentDefinition,createAgentDefinition,updateAgentDefinition, anddeleteAgentDefinitioncall the user-tier or organization-tier route for the scope.api/forkAgentDefinitions.tsadds the organization tier's list, get, create, update, and delete calls (/api/v2/chats/fork/organizations/{organization}/agent-definitions, from feat: serve organization agent definitions behind fork-agent-definitions #66).ForkAgentDefinitionsTableanduseForkAgentDefinitionEditortake ascope; the personal page passes the user tier. An editor or delete dialog still closes when the scope changes.No behavior change on the personal page. New query tests check that organization-scope list, detail, create, update and delete call the organization routes, and that create, update and delete write only into the organization's caches, leaving a same-named personal definition as it was.
Checks:
tsc,biome,oxlint,knip,lint:check,lint:compiler,lint:circular-deps, the folder's Vitest unit tests (75), the query tests (19) and the page and table view story tests pass locally.