Repository navigation
fix(cron): keep tool preambles out of IM delivery - #2389
Closed
henryZhouLikeStudy wants to merge 3 commits into
Closed
henryZhouLikeStudy wants to merge 3 commits into
henryZhouLikeStudy wants to merge 3 commits into
Conversation
|
Hi @jubaoliang ?? This PR has been open for over 3 days without movement - just wanted to gently bump it to the top of your review queue. I'm happy to rebase, adjust scope, or split it if that helps. Let me know if there's anything I can do to move this along! |
Collaborator
|
请把这个变更重新提交到 Please open this change against |
Author
|
Superseded by #2684, which retargets this fix onto \develop\ as requested (filters ordinary-tool preambles from cron delivery and history while preserving ask_agent narration and text tasks). This PR is now closed in favor of the new one. |
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.
Closes #2384
Problem
CronDeliveryService._deliver_agent()currently concatenates everytoken/deltain the turn. When a cron Agent emits a plan before calling a regular tool, that model-authored process text is prepended to the final answer and delivered to IM. The same stream also reachesTurnHistoryTracker, which can create an extra anonymous AI history row containing “plan + final answer”.Regular Weixin streaming and invoke-mode delivery already discard lead-in text before non-
ask_agenttools, but cron Agent delivery bypasses both paths.Fix
withhold_pretool_stream_chunks()as a raw-chunk state machine.ask_agent.task_type=textoutput.The filter is based on tool-call boundaries rather than language- or phrase-matching.
Validation
64 passed722 passed, 2 skipped4880 passed, 226 skipped, 12 failedC:\Windows\System32\bash.EXEcannot execute. They are unrelated to this patch.1240 files already formatted597 source filespassedCloud staging directly loaded the two production files from this commit:
Real cron / IM acceptance
A one-shot Agent cron was scheduled on the production cloud instance against an existing Weixin/iLink session with
fresh_thread=true. It was instructed to emit a plan, callcurrent_timeandls, then return onlyCRON_PREAMBLE_ACCEPTANCE_PASS.last_status=okchars=29 part=1/1The current production instance also retains #2351. Its four generated-media-related file hashes were unchanged during this deployment. This PR itself contains only the cron text-delivery fix and does not include #2351.
All acceptance evidence is sanitized: no memory or chat content, account/channel/thread/message IDs, server addresses, API keys, JWTs, or channel tokens.