Conversation
…ction (#2073) Replace the ambiguous `[Scheduled task] <task>` prefix with the imperative `Execute the following scheduled task now: <task>` in all three injection sites (agent loop, scheduler oneshot fallback, CustomTaskHandler fallback) to prevent LLMs from interpreting the annotation as metadata and cancelling bash tasks instead of executing them. Introduce SCHEDULED_TASK_PREFIX constant in zeph-core to keep all sites in sync.
55c1eeb to
86fbbde
Compare
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.
Summary
Fixes issue #2073: Scheduler task injection format is ambiguous — LLM cancels bash tasks instead of executing them.
Problem
When the scheduler fires a deferred task via the
custom_task_txinjection path, the injected message was formatted as:This is ambiguous. With
gpt-4o-mini, the LLM interprets this as informational metadata and callscancel_taskinstead of executing the bash command.Solution
Replace the ambiguous
[Scheduled task]prefix with the explicit execution directive:This imperative wording prevents LLMs from misinterpreting the annotation as metadata.
Changes
crates/zeph-core/src/agent/mod.rs): IntroducedSCHEDULED_TASK_PREFIXconstant and updated the injection format at line 2101.crates/zeph-scheduler/src/scheduler.rs): Updated oneshot fallback format at line 316-319.crates/zeph-scheduler/src/handlers.rs): Updated handler fallback format at line 33 + updated related test.test_scheduled_task_injection_formatto verify the new format (references the constant to prevent silent drift).Verification
cargo +nightly fmt,cargo clippy,cargo nextestTest Plan
test_scheduled_task_injection_formatvalidates the new format string.Issue Resolution
Resolves #2073 completely. The format change applies to all three scheduler injection points (agent loop, oneshot fallback, handler fallback), preventing LLM misinterpretation across all code paths.