fix(pipeline): ground local-agent system prompt with current date - #2399
Open
leonoxo wants to merge 1 commit into
Open
fix(pipeline): ground local-agent system prompt with current date#2399leonoxo wants to merge 1 commit into
leonoxo wants to merge 1 commit into
Conversation
The local-agent runner's system prompt is a static string with no template-variable support, so the model had no anchor for "today" and resolved relative time references (e.g. "this quarter", "latest") against whichever period was best represented in training data instead of the real date, sometimes confidently answering with stale information for time-sensitive questions. PreProcessor now appends a short, deterministically-computed "Current date: ..." note to the system prompt on every request for local-agent pipelines, alongside guidance to verify time-sensitive facts with a search tool rather than answering from memory. The existing skill-awareness prompt injection is refactored to share the same append-to-system-prompt helper.
Contributor
|
All contributors have signed the CLA. ✅ 所有贡献者均已签署 CLA。 |
Author
|
I have read the CLA Document and I hereby sign the CLA |
RockChinQ
added a commit
to langbot-app/cla
that referenced
this pull request
Aug 4, 2026
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
local-agentrunner's system prompt is a static string with no template-variable support, so the model has no anchor for "today" and resolves relative time references (e.g. "this quarter", "latest", "currently") against whichever period is best represented in its training data instead of the actual current date — this can produce confident, stale answers to time-sensitive questions (e.g. answering a "this quarter's revenue" question with year-old earnings data) instead of triggering a search tool.PreProcessornow appends a short, deterministically-computedCurrent date: YYYY-MM-DD (Weekday)note (plus guidance to verify time-sensitive facts with a search tool rather than answering from memory) to the system prompt on every request forlocal-agentpipelines — this is independent of LLM tool-call judgment, unlike binding a "get current time" MCP/tool, which the model may or may not choose to call._append_to_system_prompthelper instead of duplicating the append-to-system-message logic.Test plan
uv run pytest tests/unit_tests/pipeline/test_preproc.py -q— 13 passed (10 existing + 3 new covering: append to existing system message, create system message when none exists, skip for non-local-agentrunners)uv run pytest tests/unit_tests -q— 2664 passed, 1 skippeduv run ruff check/ruff format --checkon changed files