Skip to content

fix(execution): preserve submit failure cause and drop dead QPK fallbacks - #606

Merged
Pigbibi merged 1 commit into
mainfrom
code-health/lb-submit-cause
Oct 24, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
code-health/lb-submit-cause

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

变更

  • execution_port.submit_order 抛异常时不再静默丢弃原因:把 traceback 打印到执行日志,并在 broker_outcome_unknown_reconciliation_required 通知中附带异常类型(如 TimeoutError)。异常消息本身仍只留在本地日志,避免把 broker/provider 内部细节送进通知渠道(沿用现有 synthetic-private-* 隐私测试的约束)。
  • post-submit hook 异常同样打印 traceback 到本地日志,通知文案保持通用。
  • 删除 5 个模块中的 ImportError 兼容回退(cash_sweep、small_account_compatibility、execution_capabilities、broker_costs、notification_localization),以及 renderers/telegram 中针对旧版 QPK 的 TypeError 回退:当前 pin 350dd38e 已全部提供。共 -314 行。
  • 新增回归测试:未知结果通知保留异常类型、不泄漏异常消息。

验证

  • 干净 worktree(无 .worktrees 路径污染)全量:2162 passed, 3 skipped,含新增测试。
  • ruff check --exclude external .:All checks passed。

说明:在实际的嵌套 .worktrees/code-health-lb-submit-cause 路径下直接跑全量会出现 3 个与本改动无关的失败。原因是 tests/test_account_new_risk_gate.py 依据 ROOT.parent.name == ".worktrees" 把 ../QuantPlatformKit/src 插入 sys.path,该目录下存在 quant_platform_kit.egg-info 但无 direct_url.json,导致 importlib.metadata 读到无元数据的发行版。该测试文件在改动前后行为一致,CI 的普通 checkout 不触发;已用同一 pin 的干净 worktree 验证通过。

不涉及部署。

🤖 Generated with Claude Code

…acks

- Capture and log the traceback when the broker submit raises, and include
  the exception type in the unknown-outcome issue detail so operators no
  longer lose the cause; the exception message stays out of notifications.
- Log post-submit hook tracebacks locally while keeping the generic alert.
- Remove ImportError compatibility fallbacks for QPK cash_sweep,
  small_account_compatibility, execution_capabilities, broker_costs and
  notification_localization, plus obsolete TypeError fallbacks for
  extra_replacements/shared_wins, all provided by the pinned QPK version.
- Add a regression test asserting the unknown-submission alert keeps the
  exception type without leaking the provider message.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Pigbibi
Pigbibi merged commit 931fa75 into main Oct 24, 2026
1 check passed
@Pigbibi
Pigbibi deleted the code-health/lb-submit-cause branch October 24, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant