Repository navigation
Conversation
39e3961 to
8055457
Compare
cf56b7a to
478e973
Compare
hidb4ai
left a comment
There was a problem hiding this comment.
One reproducible issue remains in the persisted recovery diagnostics.
| code = ( | ||
| processing_error_code(error.failure.exception_type, error.failure.error_code) | ||
| if isinstance(error, _WorkerExecutionError) | ||
| else processing_error_code(type(error), _safe_error_attribute(error, "error_code", "")) |
There was a problem hiding this comment.
[P2] Preserve the Worker timeout category in retained diagnostics
When asyncio.timeout(binding.worker_timeout_seconds) expires, this branch passes TimeoutError to processing_error_code, which maps it to processing_failed. The existing _record_failure path recognizes the same exception as worker_timeout, so the live Supervisor state and the retained block disagree. I reproduced three timed-out Topic attempts with SQLite and the actual Supervisor timeout control: the Supervisor reported timeouts=3 and last_error=worker_timeout, while processing_status.block.last_error_code was processing_failed. The launcher used a deliberately hanging probe; this was not a native child-process timeout test. Once the process restarts, the retained status/block APIs lose the specific timeout diagnosis. Please persist a controlled Worker-timeout category and verify that it survives block readback after restart.
There was a problem hiding this comment.
Thanks for the clear report. Fixed in d4fe051: live and retained diagnostics now share the same classification, keeping worker_timeout and model_timeout distinct. Added SQLite regressions for status/block readback after reopening the database, using the real Supervisor deadline with a test launcher.
5eed86f to
0232c46
Compare
0232c46 to
72404b5
Compare
hidb4ai
left a comment
There was a problem hiding this comment.
One correctness issue remains in the retained attempt diagnostics. This independently confirms the range issue noted in the existing PR comment.
| scope_id=self.scope_id, | ||
| binding_name=self.binding_name, | ||
| source_after=self.source_after, | ||
| source_through=current["source_through"], |
There was a problem hiding this comment.
[P2] Persist the actual range selected for this attempt
current["source_through"] is the frontier budget's cumulative maximum, so it can exceed the end selected for this attempt when a later window becomes smaller, for example after reducing the model context limit. I independently reproduced three attempts with ends 2, 1, 1 using real async SQLite: processing_status and exact block readback associate the third attempt ID with source_through=2, although that attempt covered only (0, 1]. This makes the durable diagnostics attribute an unattempted Source to the final failure and violates the documented attempted-range contract. Please persist this attempt's selected end in its audit row, keeping the cumulative budget range and retained target separate. This reproduction did not use a live model or OceanBase.
There was a problem hiding this comment.
Thanks for the clear reproduction. Fixed in 4e7b77f: each audit row now records the selected range, independently of the cumulative budget and target. A SQLite regression covers windows 2, 1, 1 and verifies status/block readback after reopening.
|
please update & resolve conflicts |
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "contractSha256": "7e1c301bf7f2ac51781280959efd0b2d92511ddeadee8314ba1683d956c93cc7", | |||
| "contractSha256": "5e0de479c92d57c2286fe04f3ee2c8e3321798f35412fc237920c105df48ed2d", | |||
There was a problem hiding this comment.
[P2] 与当前 master 的冲突解决指引(DIRTY 状态)
本 PR 相对 base 666b043a 的桌面契约清单是一致的:head openapi/powercontext.yaml(LF 归一化)sha256 = 5e0de479...,与签入的两处清单一致,已独立复算。master 自 merge-base 以来的变化里与本 PR 相交的只有三处:operations.json/operations.ts 的 SHA 行(#1988 已把 master 侧刷成 c4571e4b)和 desktop/scripts/generate.mjs——后者只是把漂移报错文案改成带修复命令,wanted 操作集没有变化。
因此:
openapi/powercontext.yaml是纯增量(+158),与 master 合并后摘要仍为5e0de479...;- 两处清单的 SHA 冲突应保留本 PR 侧的
5e0de479...(master 侧的c4571e4b是旧契约),无需重新生成; api.d.ts与_generated/*.pymaster 侧未动,会自动合并;- 合并后建议跑一次
node desktop/scripts/generate.mjs --check终验。
其余核对结论:topic_memory_recovery.py 的锁序、租约甄别( MySQL repeatable-read 下加锁重读)、retried_at 幂等回放、stale 冲突拒绝均成立;e2e-harness 的 OB datafile 配置带 30 次自校验门控,配错会显式失败,无静默风险。本机 71 个相关测试通过(SQLite 路径)。
There was a problem hiding this comment.
感谢详细核对。已 rebase 到最新 master,保留合并后契约的 5e0de479… 摘要;两处清单一致,node desktop/scripts/generate.mjs --check 已通过。
72404b5 to
83c2142
Compare
|
Before merging, I would like a short RFC/design review of the new The table currently combines three responsibilities: per-attempt execution history, blocked-frontier diagnostics, and durable retry acceptance receipts. Persisting the receipt is necessary to prevent duplicate requests from granting another allowance after restart, but that alone does not establish the need for a Topic-specific history of every attempt, including successful attempts. Please add a concise design supplement covering:
The blocked-processing bug is worth fixing. My earlier correctness assessment should not be taken as approval of the new table's architectural boundary. I would hold the merge until we agree on the smallest durable model and its reuse/retention rationale; this is a design gate, not an additional reproduced correctness defect. |
|
Thanks for clarifying the design gate. This implementation is now draft; the focused storage-design RFC is #2018. The RFC proposes reusing existing budget rows for the current attempt and retaining only terminal-block snapshots with retry receipts, without successful-attempt history. It assesses Artifact and operational-store reuse, atomicity, ownership, indefinite block/receipt retention, legacy evidence, explicit offline migration, and expected growth with isolated SQLite sizing. I will align this implementation with the accepted design before requesting implementation review again. |
Which issue or RFC does this PR close?
Closes #1885.
Design RFC: #2018. This implementation remains draft pending agreement on the durable recovery model.
Rationale for this change
An exhausted Topic frontier prevents later Sources in the same Scope from progressing, but previously had no supported inspection or recovery API. Administrators need durable diagnostics and an explicit bounded retry that preserves the processing evidence. Worker timeout diagnostics must also remain consistent between live Supervisor state and retained block records.
What changes are included in this PR?
topic-memory status|block|retryCLI operations. Inspection requiresscope.read; retry requiresscope.adminand the observedblock_id.worker_timeoutandmodel_timeoutas distinct controlled categories.Are there any user-facing changes?
Administrators can inspect and recover blocked processing without editing the database. Retry acceptance schedules work; it does not guarantee generation success. Each accepted retry retains the three-attempt, 512-request and 64,000,000-token ceilings. Ordinary flushes, status reads, restarts and model changes grant no extra allowance.
The management APIs and audit table are additive. Existing block identities and diagnostics remain readable after recovery. Historical
processing_failedrecords are retained without guessing whether they represented timeouts.How was this change tested?
All checks on commit
4cdf119bd434321ebf2c18e98834f0190557bbd7completed: 38 passed, with the conditionalinstalled-packagejob skipped by its workflow gate. No failed or pending checks remain.Local validation:
uv sync --locked.uv run --no-sync python -X utf8 -m pytest -q tests/builtin/runtime/test_topic_memory_recovery.py tests/builtin/runtime/test_topic_memory_processing.py tests/builtin/runtime/test_topic_memory_scope.py tests/builtin/runtime/test_topic_memory_terminal_frontier.py tests/test_topic_memory_recovery_cli.py tests/e2e/test_topic_memory_recovery_access.py tests/e2e/test_topic_memory_terminal_frontier.py tests/test_api_contract.py tests/test_js_operations.py: 132 passed.pytest -n 2 tests/builtin/runtime/test_topic_memory_recovery.py -k 'timeout_diagnostics or attempt_range or generic_failed_workers': 5 passed. The timeout regression waits for the persisted terminal block and still verifies three admitted attempts, controlled categories and reopening.2, 1, 1, but the final block reported end2. It now verifies end1, cumulative budget end2, retained target3, exact block readback and file-backed SQLite reopening.node desktop/scripts/generate.mjs --checkpassed. The two desktop manifests match the combined contract hash5e0de479c92d57c2286fe04f3ee2c8e3321798f35412fc237920c105df48ed2d.uv run --no-sync prek run -a --skip ty-check: all formatting and lint hooks passed.uv run --no-sync ty check --python-platform linux --force-exclude .github desktop e2e evaluation examples integrations scripts src tests: passed for project directories, excluding local untracked research files. Changed persistence and recovery tests passed Linux- and Windows-targeted type checks.The range regression runs the actual ScopeProcessor and WindowSelector with file-backed SQLite. Timeout regressions use a test launcher with the actual Supervisor deadline. Model responses are fixtures; no live external-model or local OceanBase qualification is claimed.
AI usage statement
OpenAI Codex assisted implementation, regression testing and review. Open Code Review delegation supplied file selection and review rules: all 24 selected files were reviewed, with 15 excluded documentation, test and generated-map files checked separately. No additional blocking findings remained. The configured OCR model invocation timed out, so that incomplete invocation is not claimed as a completed independent model review.