-
Notifications
You must be signed in to change notification settings - Fork 15
feat(mcpl): transport-declared context-only messages (suppressWake) #180
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
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - A transport can declare an incoming message or push event **context-only** with `metadata.suppressWake: true` (channels/incoming) or `origin.suppressWake: true` (push events): it is stored and routed as usual but never triggers inference. The check runs before the optional EventGate, so a permissive gate (small setups that wake on every message) cannot turn a continuation chunk, a batch's non-final message, or a replay into a wake. It only ever removes a wake; transports that never set it are unaffected. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,8 +234,10 @@ export class PushHandler { | |
| const content: ContentBlock[] = params.payload.content.map(convertBlock); | ||
|
|
||
| // 4. Check shouldTriggerInference callback | ||
| let triggerInference = true; | ||
| if (this.shouldTriggerInference) { | ||
| // Same context-only contract as channels/incoming: a transport may mark | ||
| // an event (e.g. a continuation chunk) as context-only. | ||
| let triggerInference = params.origin?.suppressWake !== true; | ||
|
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.
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/mcpl/push-handler.ts
Line: 239
Comment:
**Suppressed events receive inference IDs** When `origin.suppressWake` is true, this code disables inference, but the push handler still returns an `inferenceId` in its success response. The response contract says that field is present only when inference was triggered, so the transport receives an identifier for a turn that will not occur.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| if (triggerInference && this.shouldTriggerInference) { | ||
| const textContent = content | ||
| .filter((b): b is ContentBlock & { type: 'text' } => b.type === 'text') | ||
| .map((b) => b.text) | ||
|
|
||
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.
triggerInferenceto false, but the framework still dispatches the event to the module and queues its wake request without checking that flag. The same applies to suppressed push events. The agent can therefore wake despite the transport's context-only hint.Prompt To Fix With AI