修复 Tier1 在 Postgres 上 datetime 序列化崩溃#46
Merged
Merged
Conversation
_build_structure_prompt 对原始 DB 行 json.dumps 时,PG 返回的 datetime 对象(SQLite 为字符串)抛 TypeError,Tier1 发现整体失败。 加 default=str 保持双后端一致;附回归测试(datetime 行能进 prompt)。
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.
问题
生产(PG)跑圈定后的 Tier1 发现时,agents/paradigm_agent.py 的 _build_structure_prompt 对信号原始行 json.dumps 抛 'Object of type datetime is not JSON serializable',Tier1 全程失败(Tier2 不受影响)。SQLite 时间戳为字符串,测试未暴露。
修复
json.dumps(..., default=str);回归测试:含 datetime 的信号行能正常进 prompt(master 代码上红、本分支绿)。
验证
全套 pytest:15 failed / 506 passed,失败清单为既有 15 条。