forked from Yeachan-Heo/gajae-code
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(acp): normalize session/request_permission responses into the SDK decision contract #23
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f9c0fe0
fix(test): set 30s timeout on smithery-env-trust child-process tests
gaebal-gajae 460285d
test(coding-agent): correct custom discovery limit contract
gaebal-gajae 1851fd3
fix(test): set 30s timeout on smithery-env-trust child-process tests …
Yeachan-Heo 4f6e860
test(coding-agent): correct custom discovery limit contract (#3961)
Yeachan-Heo e1cfb8d
test(coding-agent): align onboarding red-team with discovery error co…
gaebal-gajae 23849a8
ci: re-trigger Dev CI for #3966
gaebal-gajae 3832188
test(coding-agent): align onboarding red-team with discovery error co…
Yeachan-Heo accba29
fix(test): raise smithery-env-trust child-process timeout to 60s
gaebal-gajae a79df2e
fix(test): raise smithery-env-trust child-process timeout to 60s (#3967)
Yeachan-Heo 1d28c01
test(coding-agent): lock /notify on|off always-pass-through contract
gaebal-gajae fd4efb4
Merge pull request #3968 from Yeachan-Heo/fix/notify-sdk-only-pass-th…
Yeachan-Heo 05ac260
fix(acp): normalize session/request_permission responses into the SDK…
snowykr 5006314
fix(acp): cover permission response provider path
gaebal-gajae 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
56 changes: 56 additions & 0 deletions
56
packages/coding-agent/src/slash-commands/notify-command.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,56 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { lookupBuiltinSlashCommand } from "./builtin-registry"; | ||
|
|
||
| /** | ||
| * Contract: /notify on|off is session-local and extension-owned. | ||
| * The builtin must always pass the raw command text through as a prompt so it | ||
| * cannot shadow the live per-session `api.registerCommand("notify")` control — | ||
| * whether or not a lazy/native command is currently installed in the fixture. | ||
| * See builtin-registry.ts notify handler comments. | ||
| */ | ||
| function runtimeWithExtension(commandInstalled: boolean) { | ||
| const output: string[] = []; | ||
| return { | ||
| runtime: { | ||
| session: commandInstalled | ||
| ? { extensionRunner: { getCommand: () => ({ name: "notify" }) } } | ||
| : { extensionRunner: { getCommand: () => undefined } }, | ||
| settings: {}, | ||
| cwd: "/tmp", | ||
| output: async (message: string) => { | ||
| output.push(message); | ||
| }, | ||
| } as never, | ||
| output, | ||
| }; | ||
| } | ||
|
|
||
| describe("/notify SDK-only routing", () => { | ||
| test("always pass-through on/off when no lazy command is installed", async () => { | ||
| const command = lookupBuiltinSlashCommand("notify"); | ||
| if (!command?.handle) throw new Error("notify builtin handler missing"); | ||
| const { runtime, output } = runtimeWithExtension(false); | ||
| expect(await command.handle({ name: "notify", args: "on", text: "/notify on" }, runtime)).toEqual({ | ||
| prompt: "/notify on", | ||
| }); | ||
| expect(output).toEqual([]); | ||
| expect(await command.handle({ name: "notify", args: "off", text: "/notify off" }, runtime)).toEqual({ | ||
| prompt: "/notify off", | ||
| }); | ||
| expect(output).toEqual([]); | ||
| }); | ||
|
|
||
| test("always pass-through on/off when a registered native/session command is present", async () => { | ||
| const command = lookupBuiltinSlashCommand("notify"); | ||
| if (!command?.handle) throw new Error("notify builtin handler missing"); | ||
| const { runtime, output } = runtimeWithExtension(true); | ||
| expect(await command.handle({ name: "notify", args: "on", text: "/notify on" }, runtime)).toEqual({ | ||
| prompt: "/notify on", | ||
| }); | ||
| expect(output).toEqual([]); | ||
| expect(await command.handle({ name: "notify", args: "off", text: "/notify off" }, runtime)).toEqual({ | ||
| prompt: "/notify off", | ||
| }); | ||
| expect(output).toEqual([]); | ||
| }); | ||
| }); | ||
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.
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.
This ACP response-normalization commit also adds
/notifyrouting coverage and changes unrelated provider-discovery, onboarding-wizard, and Smithery-timeout tests. Bundling these independent changes makes the ACP fix harder to review, revert, or cherry-pick safely; move them into separate logical commits as required by the repository contract.AGENTS.md reference: AGENTS.md:L152-L155
Useful? React with 👍 / 👎.