-
Notifications
You must be signed in to change notification settings - Fork 665
feat: enhance agent parallelism guidance and fix skill loader issues #494
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?
Changes from all commits
5f9e693
282df36
7764526
ace0b6a
e4e6c22
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 |
|---|---|---|
|
|
@@ -4,7 +4,13 @@ import { | |
| saveAgentUsageState, | ||
| clearAgentUsageState, | ||
| } from "./storage"; | ||
| import { TARGET_TOOLS, AGENT_TOOLS, REMINDER_MESSAGE } from "./constants"; | ||
| import { | ||
| TARGET_TOOLS, | ||
| AGENT_TOOLS, | ||
| REMINDER_MESSAGE, | ||
| IMPLEMENTATION_PHASE_REMINDER, | ||
| DIRECT_TOOL_CALLS_BEFORE_REMINDER, | ||
| } from "./constants"; | ||
| import type { AgentUsageState } from "./types"; | ||
|
|
||
| interface ToolExecuteInput { | ||
|
|
@@ -37,6 +43,8 @@ export function createAgentUsageReminderHook(_ctx: PluginInput) { | |
| agentUsed: false, | ||
| reminderCount: 0, | ||
| updatedAt: Date.now(), | ||
| lastAgentUseAt: 0, | ||
|
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. P1: Missing backward compatibility for new state fields. When loading persisted state created before this PR, Prompt for AI agents |
||
| directToolCallsSinceAgent: 0, | ||
| }; | ||
| sessionStates.set(sessionID, state); | ||
| } | ||
|
|
@@ -46,6 +54,8 @@ export function createAgentUsageReminderHook(_ctx: PluginInput) { | |
| function markAgentUsed(sessionID: string): void { | ||
| const state = getOrCreateState(sessionID); | ||
| state.agentUsed = true; | ||
| state.lastAgentUseAt = Date.now(); | ||
| state.directToolCallsSinceAgent = 0; | ||
| state.updatedAt = Date.now(); | ||
| saveAgentUsageState(state); | ||
| } | ||
|
|
@@ -73,13 +83,26 @@ export function createAgentUsageReminderHook(_ctx: PluginInput) { | |
|
|
||
| const state = getOrCreateState(sessionID); | ||
|
|
||
| if (state.agentUsed) { | ||
| // First time: never used agents - show full reminder | ||
| if (!state.agentUsed) { | ||
| output.output += REMINDER_MESSAGE; | ||
| state.reminderCount++; | ||
| state.updatedAt = Date.now(); | ||
| saveAgentUsageState(state); | ||
| return; | ||
| } | ||
|
|
||
| output.output += REMINDER_MESSAGE; | ||
| state.reminderCount++; | ||
| // Has used agents before - track direct calls and remind periodically | ||
| state.directToolCallsSinceAgent++; | ||
| state.updatedAt = Date.now(); | ||
|
|
||
| // Remind again after N direct tool calls without using agents | ||
| if (state.directToolCallsSinceAgent >= DIRECT_TOOL_CALLS_BEFORE_REMINDER) { | ||
| output.output += IMPLEMENTATION_PHASE_REMINDER; | ||
| state.reminderCount++; | ||
| state.directToolCallsSinceAgent = 0; | ||
| } | ||
|
|
||
| saveAgentUsageState(state); | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
P1: Using only
scopes[0]applies the same scope to all directories, ignoring the parallel array relationship. Each directory should use its corresponding scope from the array.Prompt for AI agents