-
Notifications
You must be signed in to change notification settings - Fork 4
feat(ui): dedicated chat components for tool search/select/query #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3226492
test(engine): isolate git fixture signing
Zerlight 369498b
feat(ui,workbench,i18n): humanize search tool rows and render ToolSea…
Zerlight 2642d69
feat(ui): give search and ToolSearch rows expressive icons
Zerlight 1d54c81
fix(ui): preserve search context across states
Zerlight 2fb82cb
fix(agent-adapter): normalize codex MCP tool titles to the shared mcp…
Zerlight 1e8785c
fix(ui): keep ToolSearch select wording neutral without result rows
Zerlight ef18550
fix(agent-adapter): normalize codex MCP rollout replay titles to the …
Zerlight 9a3fcb9
fix(ui): keep uncounted search queries as the header summary
Zerlight c4fa4a1
fix(agent-adapter): keep codex's dotted title for __-bearing MCP serv…
Zerlight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
packages/host/agent-adapter/src/__tests__/codex-mcp-tools.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import type { AgentEvent, StartOptions } from '@linkcode/schema'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { CodexAdapter } from '../native/codex'; | ||
| import type { CodexServerHandle } from '../native/codex/adapter'; | ||
| import type { CodexAppServerOptions } from '../native/codex/app-server'; | ||
|
|
||
| /** Minimal fake satisfying `CodexServerHandle`, same shape as codex-compaction.test.ts's. */ | ||
| class FakeCodexServer { | ||
| constructor(private readonly opts: Omit<CodexAppServerOptions, 'binaryPath'>) {} | ||
| request(method: string): Promise<unknown> { | ||
| if (method === 'thread/start' || method === 'thread/resume') { | ||
| return Promise.resolve({ thread: { id: 'thread-1' } }); | ||
| } | ||
| return Promise.resolve({}); | ||
| } | ||
| setRequestHandler(): void { | ||
| // Approvals never fire on this path. | ||
| } | ||
| close(): void { | ||
| // Nothing to reap. | ||
| } | ||
| notify(method: string, params: unknown): void { | ||
| this.opts.onNotification(method, params); | ||
| } | ||
| } | ||
|
|
||
| class TestCodex extends CodexAdapter { | ||
| fakeServers: FakeCodexServer[] = []; | ||
| protected override startAppServer( | ||
| opts: Omit<CodexAppServerOptions, 'binaryPath'>, | ||
| ): Promise<CodexServerHandle> { | ||
| const server = new FakeCodexServer(opts); | ||
| this.fakeServers.push(server); | ||
| return Promise.resolve(server); | ||
| } | ||
| protected override readConfiguredSandbox() { | ||
| return Promise.resolve(undefined); | ||
| } | ||
| } | ||
|
|
||
| const start: StartOptions = { kind: 'codex', cwd: '/repo' }; | ||
|
|
||
| function toolTitles(events: AgentEvent[]) { | ||
| return events.flatMap((event) => (event.type === 'tool-call' ? [event.toolCall.title] : [])); | ||
| } | ||
|
|
||
| describe('CodexAdapter mcpToolCall items', () => { | ||
| it('emits the shared mcp slug and strips the codex_apps plugin namespace', async () => { | ||
| const adapter = new TestCodex(); | ||
| const events: AgentEvent[] = []; | ||
| adapter.onEvent((e) => events.push(e)); | ||
| await adapter.start(start); | ||
| const server = adapter.fakeServers[0]; | ||
|
|
||
| server.notify('turn/started', { turn: { id: 'turn-1' } }); | ||
| // Real 0.144.6 shape: plugin apps mount under ONE `codex_apps` server, plugin in the tool name. | ||
| server.notify('item/started', { | ||
| item: { | ||
| type: 'mcpToolCall', | ||
| id: 'mcp-1', | ||
| server: 'codex_apps', | ||
| tool: 'linear.list_issues', | ||
| status: 'inProgress', | ||
| arguments: { limit: 50 }, | ||
| }, | ||
| }); | ||
| server.notify('item/started', { | ||
| item: { type: 'mcpToolCall', id: 'mcp-2', server: 'context7', tool: 'resolve_library' }, | ||
| }); | ||
| server.notify('item/started', { | ||
| item: { type: 'mcpToolCall', id: 'mcp-3', server: 'codex_apps', tool: 'dotless' }, | ||
| }); | ||
| // Codex accepts `__` in server names; the slug would mis-split, so the raw title survives. | ||
| server.notify('item/started', { | ||
| item: { type: 'mcpToolCall', id: 'mcp-4', server: 'repo__prod', tool: 'search_files' }, | ||
| }); | ||
| server.notify('turn/completed', { turn: { id: 'turn-1', status: 'completed' } }); | ||
|
|
||
| // Announce + teardown settle both re-emit the full snapshot; the title must be stable. | ||
| expect([...new Set(toolTitles(events))]).toEqual([ | ||
| 'mcp__linear__list_issues', | ||
| 'mcp__context7__resolve_library', | ||
| 'mcp__codex_apps__dotless', | ||
| 'repo__prod.search_files', | ||
| ]); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CODEX_PLUGIN_APPS_SERVERhas no importer — it was module-private inadapter.tsbefore the move andcodexMcpSlugright below is still its only reader. Meanwhilehistory-tools.ts:134hard-codes the duplicate'codex_apps__'literal rather than deriving from it, so the export buys nothing.