fix: pass agent summaries array instead of client object to createBuiltinAgents (#2386)#2478
Closed
code-yeongyu wants to merge 1 commit intodevfrom
Closed
fix: pass agent summaries array instead of client object to createBuiltinAgents (#2386)#2478code-yeongyu wants to merge 1 commit intodevfrom
code-yeongyu wants to merge 1 commit intodevfrom
Conversation
…ltinAgents (#2386) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
Owner
Author
|
Duplicate of #2424 which already passes CI |
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- There is a concrete regression risk in
src/plugin-handlers/agent-config-handler.ts:buildandplansubagent configs are being passed as visible custom agents, which can pollute the orchestrator prompt behavior. - The issue is high-confidence (10/10) and meaningful severity (7/10), so this is more than a minor cleanup concern and could affect user-visible agent selection/prompt quality.
- Pay close attention to
src/plugin-handlers/agent-config-handler.ts- ensure subagent configs are filtered/mapped correctly so only intended custom agents are exposed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/plugin-handlers/agent-config-handler.ts">
<violation number="1" location="src/plugin-handlers/agent-config-handler.ts:97">
P1: The "build" and "plan" subagent configs will be incorrectly passed as visible custom agents, polluting the orchestrator prompt.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| ...pluginAgents, | ||
| ...configAgent, | ||
| }) | ||
| .filter((entry): entry is [string, Record<string, unknown>] => { |
There was a problem hiding this comment.
P1: The "build" and "plan" subagent configs will be incorrectly passed as visible custom agents, polluting the orchestrator prompt.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/plugin-handlers/agent-config-handler.ts, line 97:
<comment>The "build" and "plan" subagent configs will be incorrectly passed as visible custom agents, polluting the orchestrator prompt.</comment>
<file context>
@@ -77,6 +77,31 @@ export async function applyAgentConfig(params: {
+ ...pluginAgents,
+ ...configAgent,
+ })
+ .filter((entry): entry is [string, Record<string, unknown>] => {
+ const registeredAgent = entry[1];
+ return typeof registeredAgent === "object" && registeredAgent !== null;
</file context>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
createBuiltinAgents()so custom agents are injected into builtin orchestrator prompts.createBuiltinAgents()andparseRegisteredAgentSummaries()behavior unchanged.Validation
bun run typecheckbun test(fails in existingsrc/plugin-config.test.tsassertions unrelated to this change in this worktree)Summary by cubic
Pass registered agent summaries to
createBuiltinAgentsand load them before builtin creation, so custom agents are correctly injected into builtin orchestrator prompts. Fixes missing Claude Code, plugin, and config agents whenclaude_code.agentsis enabled.registeredAgentSummariesfrom user, project, plugin, and config agents, and pass it tocreateBuiltinAgents(replacesparams.ctx.client).Written for commit 943dd36. Summary will update on new commits.