Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(agent): detect U+FF5C DSML bars, mark unwritten-target runs degraded, accurate safe-fallback reason

Will Liao05d46b50b168
diff --git a/agent/src/agent/grounding.py b/agent/src/agent/grounding.py
index 2ef037cfe..8a094bb65 100644
--- a/agent/src/agent/grounding.py
+++ b/agent/src/agent/grounding.py
@@ -1358,6 +1358,29 @@ class GroundingLedger:
f"The verified observed OHLC range is: {joined}. "
"I will not invent an entry price without a visible derivation or refreshed evidence."
)
+ # No observed price evidence: distinguish "identity unresolved" from
+ # "the draft cited prices this session never observed". Reporting the
+ # identity message for the latter is misleading (the run may not even
+ # have touched the market tools).
+ issue_codes = {
+ code
+ for validation in self._validations
+ for code in (issue.get("code") for issue in validation.get("issues", []))
+ }
+ if issue_codes & {
+ "numeric_claim_unavailable", "numeric_claim_conflict", "unsourced_symbol_figures"
+ }:
+ if is_zh:
+ return (
+ "我的回答被安全门槛拒绝:草稿引用了本会话未通过工具获取的价格数字,无法核验。"
+ "请重新发起任务,让模型先调用行情工具获取数据,或要求它去掉这些价格引用后重试。"
+ )
+ return (
+ "My previous answer was rejected by the verification gate: it cited price "
+ "figures that this session never obtained through a tool, so they could not "
+ "be verified. Re-run the task and let the agent fetch the market data first, "
+ "or ask it to answer without the unverified prices."
+ )
if is_zh:
return (
"当前无法安全确认标的身份或价格证据,因此没有生成交易结论。"
diff --git a/agent/tests/artifacts/grounding_evidence.json b/agent/tests/artifacts/grounding_evidence.json
new file mode 100644
index 000000000..3ab748489
--- /dev/null
+++ b/agent/tests/artifacts/grounding_evidence.json
@@ -0,0 +1,22 @@
+{
+ "evidence": [],
+ "identity": {
+ "authorized_symbols": [],
+ "records": [],
+ "recovery": {
+ "max_price_evidence_attempts": 3,
+ "max_rounds": 6,
+ "max_symbol_resolution_attempts": 2,
+ "price_evidence_attempts": 0,
+ "rounds": 0,
+ "symbol_resolution_attempts": 0
+ },
+ "status": "not_required"
+ },
+ "schema_version": 1,
+ "session_symbol_roots": [],
+ "session_symbols": [],
+ "tool_failures": [],
+ "updated_at": "2026-08-15T18:15:36.590075Z",
+ "validations": []
+}