Uh oh!
There was an error while loading. Please reload this page.
housekeeping: forecast task name + system-message merge (#6) - #10
Merged
Conversation
- Add forecast to TASK_NAMES / TaskName: the server accepts <task>forecast</task> (ALLOWED_USER_TOOLS, messaging.ts:97-105), so it should be typeable. (#6.1) - prepare() merges <task>/<guard> tags into the caller's first system message instead of prepending a second one. The server reads only the first system message (getAllRequiredMessages), so a prepended tag-only message displaced the caller's real system prompt. (#6.3) #6.2 (mixed-shape precontext fixture) is already added in #7.
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 freeto 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.
Fixes#6
Addresses the housekeeping items:
1.
TaskNameomitsforecast(#6.1)The server accepts
<task>forecast</task>—ALLOWED_USER_TOOLSincludesforecast(src/utils/messaging.ts:97-105), andmain.ts:203reads it from an explicit<task>tag. AddedforecasttoTASK_NAMESand theTaskNameliteral socreate(task="forecast")is typeable, matching the other tasks.3.
task/guardinjected as a separate leading system message (#6.3)prepare()prepended a new{role: "system"}message. But the server reads only the first system message (getAllRequiredMessagesbreaks on the firstrole === "system", extracts the tags via a tolerant regex, then splices that one out and uses it as the system prompt). So when the caller already had a system message, the prepended tag-only message became "first" and displaced the caller's real system prompt.Now the tags are merged into the caller's first system message (when it has string content); the tolerant
/<task>([\s\S]*?)<\/task>/regex still finds them. Falls back to a prepended system message when there's no string-content system message (e.g. list content, which the server can't regex anyway).2. Fixtures (#6.2)
Already addressed — the mixed-shape precontext fixture (
MIXED_PRECONTEXT) is added in #7 alongside the strict-validation fix.Tests
Added:
forecastserializes as a task; tags merge into an existing system message (exactly one system message, contains task + guard + the caller's text). Suite: 26 passing;ruff+mypy --strictclean.