Repository navigation
feat(site/src/pages/AgentsPage): add fork hooks for tool renderers and the composer - #30
Conversation
…d the composer Fork features need to add chat tool renderers and composer controls without editing two hot upstream files. Tool.tsx now spreads forkToolRenderers into toolRenderers, and AgentChatInput.tsx renders ForkComposerSlot in the composer controls, one hook line plus one import each. Both fork files hold nothing today, so no tool row and no control changes. The spread sits last in toolRenderers, so a fork name that matched an upstream name would replace the upstream renderer. Fork names therefore stay inside the reserved "fork_" prefix, and forkToolRenderers.test.ts keeps fork names in that prefix and keeps upstream names out of it. ToolRendererProps is exported so the fork map carries the same type as the upstream one.
|
@codex review
|
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c97cbdb87
ℹ️ 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".
…e and document the fork hooks
|
@codex review
|
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
|
Part of #5
Adds the two frontend hooks that fork features use, so the two hot upstream Agents page files carry one fork line each and an upstream sync does not merge into fork code. Both hooks are empty for now, so no tool row and no composer control changes.
forkToolRenderers(ChatElements/tools/forkToolRenderers.ts) is spread last intotoolRenderersinTool.tsx. Its renderer props type comes fromtypeof toolRenderers, soTool.tsxexports nothing new.ForkComposerSlot(components/ForkComposerSlot.tsx) renders first in the composer controls row ofAgentChatInput.tsx, before the context usage indicator, so mic and send stay rightmost. It getschatIdandisDisabledand rendersnulltoday.AgentCreateFormalso usesAgentChatInput, so the slot mounts there too.Because the spread is last, a fork renderer with an upstream tool name would replace the upstream one. Fork tool names therefore use the reserved
fork_prefix:forkToolRenderers.test.tschecks that every fork key has the prefix, and, with the fork map mocked empty, that no upstream renderer uses it.Upstream edits: an import plus one line in each of
AgentChatInput.tsxandTool.tsx.UAT passed on 5f51c8c (base main d4e1dfc): in headless Chromium, the composer DOM and screenshots on the chat page and on
/agents, and the tool rows, match main. The head since then only mergesmain(#27 and #28), which changes no file undersite/.Validation
Run in
node:22-bookwormwith the repobiome.jsoncmounted:pnpm install --frozen-lockfile;pnpm run lint(Biome, oxlint,tsc -p ., dpdm with no circular dependency,check-compiler.mjs, knip);pnpm exec biome check --error-on-warnings ..pnpm exec vitest run --project=unit src/pages/AgentsPage: 144 files, 2677 passed, 2 skipped, on the first commit; after the review fixes,ChatElements/toolsandAgentChatInput.test.tsxagain (20 files, 340 passed), includingforkToolRenderers.test.ts,toolIconsCoverage.test.ts,toolLabelVisibility.test.tsandAgentChatInput.test.tsx.executetoforkToolRenderers, or registering afork_shadowrenderer upstream, failsforkToolRenderers.test.ts.frontend-deep-reviewandfrontend-reviewself-review: all comment findings fixed, no open blocking or should-fix items.