-
-
Notifications
You must be signed in to change notification settings - Fork 260
fix: announcement ordering, UTF-16-safe label cap, base prompt spend list #3747
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -648,7 +648,7 @@ const AGENT_API_BASE_PROMPT_LINES: readonly string[] = [ | |
| "- Before authoring tool-call assertions, check the server's real tool names with `list_server_tools`.", | ||
| "- Author cases as `steps` arrays; prefer a `prompt` step plus `toolCalledWith`-style assertions on the tools the conversation showed. Set `expectedOutput` when the user stated one.", | ||
| `- When creating a suite, set the suite \`model\` explicitly to \`${DEFAULT_SUITE_MODEL}\` unless the user asks for a different model.`, | ||
| "- Some actions SPEND the user's quota or credits (running a suite or a case, generating cases, cancelling a run). Calling those tools does NOT perform them: it PROPOSES the action and returns an approval id, and a person must click to confirm. Say that you've proposed it and what it will do. NEVER say it has started, is running, or has been cancelled.", | ||
| "- Some actions SPEND the user's quota or credits (running a suite or a case, generating cases, cancelling a run, setting a schedule, running a third-party tool). Calling those tools does NOT perform them: it PROPOSES the action and returns an approval id, and a person must click to confirm. Say that you've proposed it and what it will do. NEVER say it has started, is running, or has been cancelled.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Correct the shared base-prompt classification. The prompt currently presents
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| "- If a proposal tool is not available to you, you cannot run anything at all. Say so plainly and report the ids the user needs — do not imply you started something.", | ||
| "- Always report the ids of anything you created.", | ||
| "- Tool input schemas are AUTHORITATIVE. Never consult docs to learn a tool's argument shape — the schema you were given is the truth. If a tool returns a validation error naming fields, correct exactly those fields and retry the same call.", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,11 @@ export function announcementFor(outcome, userId) { | |
| (outcome.resource && typeof outcome.resource.url === 'string' ? outcome.resource.url : null) ?? | ||
| outcome.runUrl ?? | ||
| null; | ||
| if (url) return `:white_check_mark: Approved by <@${userId}> — <${url}|follow it here>.`; | ||
|
|
||
| switch (outcome.kind) { | ||
| case 'cancel': | ||
| // KIND WINS over any resource URL. A cancel that also returns a resource | ||
| // should still say "Cancelled", not "Approved — follow it here". | ||
| return `:white_check_mark: Cancelled by <@${userId}>.`; | ||
| case 'generate': | ||
| return `:white_check_mark: Approved by <@${userId}> — the cases are being generated.`; | ||
|
|
@@ -60,11 +61,15 @@ export function announcementFor(outcome, userId) { | |
| case 'external': | ||
| return `:white_check_mark: Approved by <@${userId}> — the tool ran.`; | ||
| case 'start': | ||
| if (url) return `:white_check_mark: Approved by <@${userId}> — <${url}|follow it here>.`; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Reordering kind-vs-URL to fix the cancel-with-resource case is correct, but it also silently drops the server-built "follow it here" link for the other known kinds. Before this change the URL was consulted before the switch, so a Prompt for AI agents |
||
| return `:white_check_mark: Approved by <@${userId}>, and it's away.`; | ||
| default: | ||
| break; | ||
| } | ||
|
|
||
| // URL fallback for kinds this build does not recognise (newer server). | ||
| if (url) return `:white_check_mark: Approved by <@${userId}> — <${url}|follow it here>.`; | ||
|
|
||
| // A kind we do not recognise means a NEWER server, and the operation-name | ||
| // table below is older than the kind vocabulary — consulting it would let a | ||
| // brand-new action be announced as "it's away" on the strength of a name | ||
|
|
||
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.
P3: The updated base prompt line now lists 'running a third-party tool' alongside quota-spending actions and describes schedule changes generically as spend. If call_server_tool is actually gated for external side effects rather than quota consumption, and only enabling a schedule (not disabling one) creates recurring spend, this wording could mislead the agent/user about what each action actually costs. Consider splitting the description so call_server_tool is described as an external action requiring approval, and only 'enabling' a schedule is called out as spend.
Prompt for AI agents