-
Notifications
You must be signed in to change notification settings - Fork 51
fix: preserve Goal continuation through compaction recovery #640
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
832a3d8
81b9aa4
5eab370
e9582f4
5f3d3c0
d078b70
b58dd41
a307ea1
6dd841e
fc90cf4
f124e56
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 |
|---|---|---|
|
|
@@ -145,6 +145,8 @@ export interface PrepareNextTurnContext extends ShouldStopAfterTurnContext {} | |
|
|
||
| export interface AgentLoopConfig extends SimpleStreamOptions { | ||
| model: Model<any>; | ||
| /** Last-moment admission check before a queued message enters loop-owned context. */ | ||
|
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: Direct prompts are also subject to this callback, not just queued messages; the current comment understates the API scope and can lead callers to assume Prompt for AI agents |
||
| shouldDeliverMessage?: (message: AgentMessage) => boolean; | ||
|
|
||
| /** | ||
| * Maximum time in milliseconds to wait for the FIRST provider stream event. | ||
|
|
||
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: When a run's entire initial prompt batch is filtered out by
shouldDeliverMessage, this path emitsturn_startand then jumps straight toagent_endwithout the matchingturn_end. Every other runLoop exit emitsturn_endbeforeagent_end, so listeners that pair turn lifecycle events (turn accounting / loop consumers) will see an unbalancedturn_start. Consider emittingturn_endwith empty results beforeagent_endon this early-return path, or skip emittingagent_start/turn_startfor an empty, fully-suppressed batch.Prompt for AI agents