-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(agents): replace deprecated getAgentListDisplayName with getAgentDisplayName (fixes #3281) #3407
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: dev
Are you sure you want to change the base?
fix(agents): replace deprecated getAgentListDisplayName with getAgentDisplayName (fixes #3281) #3407
Changes from 3 commits
7c69a12
ddfe87a
8aaa724
ad09192
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 |
|---|---|---|
|
|
@@ -24,7 +24,6 @@ import { | |
| } from "./agent-override-protection"; | ||
| import { buildPrometheusAgentConfig } from "./prometheus-agent-config-builder"; | ||
| import { buildPlanDemoteConfig } from "./plan-model-inheritance"; | ||
| import { getAgentListDisplayName } from "../shared/agent-display-names"; | ||
|
|
||
| type AgentConfigRecord = Record<string, Record<string, unknown> | undefined> & { | ||
| build?: Record<string, unknown>; | ||
|
|
@@ -160,10 +159,10 @@ export async function applyAgentConfig(params: { | |
| if (isSisyphusEnabled && builtinAgents.sisyphus) { | ||
| if (configuredDefaultAgent) { | ||
| (params.config as { default_agent?: string }).default_agent = | ||
| getAgentListDisplayName(configuredDefaultAgent); | ||
| getAgentDisplayName(configuredDefaultAgent); | ||
|
Comment on lines
161
to
+162
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.
Useful? React with 👍 / 👎. |
||
| } else { | ||
| (params.config as { default_agent?: string }).default_agent = | ||
| getAgentListDisplayName("sisyphus"); | ||
| getAgentDisplayName("sisyphus"); | ||
| } | ||
|
|
||
| // Assembly order: Sisyphus -> Hephaestus -> Prometheus -> Atlas | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||||||||||
| import { describe, it, expect } from "bun:test" | ||||||||||||||||||
| import { remapAgentKeysToDisplayNames } from "./agent-key-remapper" | ||||||||||||||||||
| import { getAgentDisplayName, getAgentListDisplayName } from "../shared/agent-display-names" | ||||||||||||||||||
| import { getAgentDisplayName } from "../shared/agent-display-names" | ||||||||||||||||||
|
|
||||||||||||||||||
| describe("remapAgentKeysToDisplayNames", () => { | ||||||||||||||||||
| it("remaps known agent keys to display names", () => { | ||||||||||||||||||
|
|
@@ -14,7 +14,7 @@ describe("remapAgentKeysToDisplayNames", () => { | |||||||||||||||||
| const result = remapAgentKeysToDisplayNames(agents) | ||||||||||||||||||
|
|
||||||||||||||||||
| // then known agents get display name keys only | ||||||||||||||||||
| expect(result[getAgentListDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(result["oracle"]).toBeDefined() | ||||||||||||||||||
| expect(result["sisyphus"]).toBeUndefined() | ||||||||||||||||||
| }) | ||||||||||||||||||
|
|
@@ -49,13 +49,13 @@ describe("remapAgentKeysToDisplayNames", () => { | |||||||||||||||||
| const result = remapAgentKeysToDisplayNames(agents) | ||||||||||||||||||
|
|
||||||||||||||||||
| // then all get display name keys | ||||||||||||||||||
| expect(result[getAgentListDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(result["sisyphus"]).toBeUndefined() | ||||||||||||||||||
| expect(result[getAgentListDisplayName("hephaestus")]).toBeDefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("hephaestus")]).toBeDefined() | ||||||||||||||||||
| expect(result["hephaestus"]).toBeUndefined() | ||||||||||||||||||
| expect(result[getAgentListDisplayName("prometheus")]).toBeDefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("prometheus")]).toBeDefined() | ||||||||||||||||||
| expect(result["prometheus"]).toBeUndefined() | ||||||||||||||||||
| expect(result[getAgentListDisplayName("atlas")]).toBeDefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("atlas")]).toBeDefined() | ||||||||||||||||||
| expect(result["atlas"]).toBeUndefined() | ||||||||||||||||||
| expect(result[getAgentDisplayName("athena")]).toBeDefined() | ||||||||||||||||||
| expect(result["athena"]).toBeUndefined() | ||||||||||||||||||
|
|
@@ -77,8 +77,8 @@ describe("remapAgentKeysToDisplayNames", () => { | |||||||||||||||||
| const result = remapAgentKeysToDisplayNames(agents) | ||||||||||||||||||
|
|
||||||||||||||||||
| // then only display key is emitted | ||||||||||||||||||
| expect(Object.keys(result)).toEqual([getAgentListDisplayName("sisyphus")]) | ||||||||||||||||||
| expect(result[getAgentListDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(Object.keys(result)).toEqual([getAgentDisplayName("sisyphus")]) | ||||||||||||||||||
| expect(result[getAgentDisplayName("sisyphus")]).toBeDefined() | ||||||||||||||||||
| expect(result["sisyphus"]).toBeUndefined() | ||||||||||||||||||
| }) | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -96,10 +96,10 @@ describe("remapAgentKeysToDisplayNames", () => { | |||||||||||||||||
|
|
||||||||||||||||||
| // then | ||||||||||||||||||
| expect(sortedNames).toEqual([ | ||||||||||||||||||
| getAgentListDisplayName("sisyphus"), | ||||||||||||||||||
| getAgentListDisplayName("hephaestus"), | ||||||||||||||||||
| getAgentListDisplayName("prometheus"), | ||||||||||||||||||
| getAgentListDisplayName("atlas"), | ||||||||||||||||||
| getAgentDisplayName("sisyphus"), | ||||||||||||||||||
| getAgentDisplayName("hephaestus"), | ||||||||||||||||||
| getAgentDisplayName("prometheus"), | ||||||||||||||||||
| getAgentDisplayName("atlas"), | ||||||||||||||||||
|
Comment on lines
+99
to
+102
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. P2: Update the expected sorted order to match the clean display names, or this test will fail after removing the ZWSP prefixes. Prompt for AI agents
Suggested change
|
||||||||||||||||||
| ]) | ||||||||||||||||||
| }) | ||||||||||||||||||
| }) | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| import { getAgentListDisplayName } from "../shared/agent-display-names" | ||
| import { getAgentDisplayName } from "../shared/agent-display-names" | ||
|
|
||
| export function remapAgentKeysToDisplayNames( | ||
| agents: Record<string, unknown>, | ||
| ): Record<string, unknown> { | ||
| const result: Record<string, unknown> = {} | ||
|
|
||
| for (const [key, value] of Object.entries(agents)) { | ||
| const displayName = getAgentListDisplayName(key) | ||
| const displayName = getAgentDisplayName(key) | ||
|
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.
Using Useful? React with 👍 / 👎. |
||
| if (displayName && displayName !== key) { | ||
| result[displayName] = value | ||
| // Regression guard: do not also assign result[key]. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.