-
Notifications
You must be signed in to change notification settings - Fork 0
fix: accept event-driven routing exit #35
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
Changes from 13 commits
a9e177d
e44e81c
b41b72a
602e3c1
cd0ba30
218e847
dbda45b
9261a82
f2c697c
46af136
0d59344
3bb9edb
b4bca5d
76e66bf
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 |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ | |
| * KD-8 safe:只看"有无机械出口信号",零意图分类器。 | ||
| */ | ||
|
|
||
| import { hasEventDrivenExternalWaitExit } from '../final-routing-slot.js'; | ||
|
|
||
| /** Routing-tool substrings that count as a legitimate exit (持球/群发传球). */ | ||
| const ROUTING_TOOL_SUBSTRINGS = ['hold_ball', 'multi_mention'] as const; | ||
|
|
||
|
|
@@ -23,6 +25,8 @@ function hasRoutingToolCall(toolNames: readonly string[]): boolean { | |
| } | ||
|
|
||
| export interface RoutingExitInput { | ||
| /** Stored output text. Only the final routing slot is inspected for structural external-wait exits. */ | ||
| readonly text?: string; | ||
| /** Line-start @cat mentions parsed this turn (parseA2AMentions). */ | ||
| readonly lineStartMentions: readonly string[]; | ||
| /** Tool names invoked this turn (scan for hold_ball / multi_mention). */ | ||
|
|
@@ -31,18 +35,22 @@ export interface RoutingExitInput { | |
| readonly structuredTargetCats: readonly string[]; | ||
| /** Line-start @co-creator / @co-creator escalation to co-creator. */ | ||
| readonly hasCoCreatorLineStartMention?: boolean; | ||
| /** True only when the route has verified callback/EYES coverage for a 2b event-driven wait. */ | ||
| readonly hasEventDrivenExternalWaitCoverage?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * True iff the turn has a legitimate routing exit (传球 / 持球 / 升级). | ||
| * Mirrors the suppression set of evaluateVoidHold + F177-G hook | ||
| * (line-start @, hold_ball, multi_mention, targetCats, co-creator). | ||
| * (line-start @, hold_ball, multi_mention, targetCats, co-creator, structural | ||
| * 2b external wait slot with verified callback coverage). | ||
| */ | ||
| export function hasValidRoutingExit(input: RoutingExitInput): boolean { | ||
| if (input.lineStartMentions.length > 0) return true; | ||
| if (input.structuredTargetCats.length > 0) return true; | ||
| if (input.hasCoCreatorLineStartMention) return true; | ||
| if (hasRoutingToolCall(input.toolNames)) return true; | ||
| if (input.hasEventDrivenExternalWaitCoverage && hasEventDrivenExternalWaitExit(input.text)) return true; | ||
| return false; | ||
| } | ||
|
|
||
|
|
@@ -74,6 +82,7 @@ export const REMEDIAL_PROMPT = | |
| '请只补一个出口,不要重做刚才的工作:\n' + | ||
| '- 传球:另起一行,行首独立写 @句柄(如 @opus48)\n' + | ||
| '- 持球等外部条件:调用 cat_cafe_hold_ball\n' + | ||
| '- 事件驱动外部等待(已有结构化回调 + EYES>0):另起一行写 External Wait: event-driven (<id>)\n' + | ||
|
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.
When a guarded cat first produces useful content but no route exit, this new prompt can now make the remedial call answer with only Useful? React with 👍 / 👎.
Author
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. Fixed in |
||
| '- 升级co-creator:另起一行行首写 @co-creator'; | ||
|
|
||
| export function buildRemedialPrompt(): string { | ||
|
|
||
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.
When a first pass has useful text but no exit, this new remedial option asks the model to return only
External Wait: event-driven (<id>); howeverroute-serialstill treats only@...remedials as route-only, so an event-driven remedial is handled as replacement content and the persisted/visible message becomes just the wait line, discarding the original work the guard was supposed to patch. Please extend the route-only normalization/preservation path for this structural template before teaching the remedial prompt to emit it.Useful? React with 👍 / 👎.
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.
Fixed in
b41b72a3as part of the current-head preservation fix. Event-driven external-wait remedials are included in route-only normalization, so the first-pass content is preserved instead of replaced by the bare wait line. Focused suite is 85/85; expanded guard suite is 122/122;pnpm checkpassed.