PostToolUse diagnostics timeout when TypeScript diagnostics remain empty
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Start by reading plugins/omo/components/lsp/src/codex-hook.ts and the LSP daemon source that produces the bundled plugins/omo/components/lsp-daemon/dist/cli.js; the issue identifies the freshness wait and TypeScript diagnostic behavior. Check the daemon’s existing tests and add regression coverage for repeated valid edits with empty diagnostics, plus the syntax error and repair transition. Done when PostToolUse returns current empty diagnostics without timing out, while errors appear and clear correctly.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The OMO PostToolUse diagnostics hook blocks repeated edits when TypeScript Language Server has an unchanged empty diagnostics set. The server correctly suppresses duplicate empty publishes, but OMO waits for a new publish after every edit and reports a 3-second freshness timeout.
Environment
- LazyCodex: 5.1.40
- Codex CLI: 0.163.0
- OS: macOS 25.5, arm64
- Install: installed OMO plugin cache
- LSP:
typescript-language-server6.0.2 with TypeScript 6.0.3; TypeScript configured for.mjs
Repository Decision
- Target:
code-yeongyu/lazycodex - Why: the failure is in OMO's bundled LSP daemon freshness contract and PostToolUse integration. Fresh upstream Codex has no OMO hook/daemon implementation; current Codex source search contains no
lsp-daemon,omo-lsp, ordiagnosticsFreshnessTimeout. - LazyCodex evidence: latest source is
bca7c59b870b1d468e7d2ea869ef263661a2c8d8. Its PostToolUse path isplugins/omo/components/lsp/src/codex-hook.ts; the shipped generated daemon atplugins/omo/components/lsp-daemon/dist/cli.jsrequires a fresh publish or pull result for the current document generation (lines 2191-2203 and 3540-3602). - Upstream Codex comparison: a fresh
openai/codexsync atd138398cef7d49e46fe33f1d0ddbd2ca0ed16aa4has no corresponding hook or daemon code. - Existing issue check: no matching issue found. #90 concerns a daemon bootstrap regression that dropped diagnostics; #154 concerns paths outside session CWD. This is a distinct empty-set freshness timeout.
Reproduction
Using an installed OMO 5.1.40 plugin and an active TypeScript LSP client rooted at a checkout:
- Create an ignored JS file inside the checkout, for example
.omo/evidence/lsp-probe.mjs. - For each value below, write
export const value = N;\nto the same file and invoke the shipped hook CLI from the checkout root with the corresponding PostToolUse payload:
PLUGIN_ROOT="$HOME/.codex/plugins/cache/sisyphuslabs/omo/5.1.40"
ROOT="/path/to/checkout"
FILE="$ROOT/.omo/evidence/lsp-probe.mjs"
mkdir -p "$(dirname "$FILE")"
for n in 1 2 3; do
printf 'export const value = %s;\n' "$n" > "$FILE"
printf '{"session_id":"lsp-repro-%s","tool_name":"Edit","tool_input":{"path":"%s"},"tool_response":{"success":true}}' "$n" "$FILE" |
node "$PLUGIN_ROOT/components/lsp/dist/cli.js" hook post-tool-use
done
- The first call opens/warms the file; subsequent calls are content-only edits that keep diagnostics empty.
Expected Behavior
The hook should return the authoritative current diagnostics (empty for these valid edits) or a clearly non-blocking unavailable result. It should not block an otherwise valid edit just because the server has no changed diagnostic notification to send.
Actual Behavior
On the active Merge Gate worktree, the repeated real PostToolUse hook returned no output for the first edit (685 ms), then blocked edits 2 and 3 after 3069 and 3067 ms:
{"decision":"block","reason":"LSP diagnostics after editing .../.omo/evidence/lsp-probe.mjs:\n\nTimed out waiting for fresh diagnostics for .../.omo/evidence/lsp-probe.mjs within 3000ms."}
A controlled transition on the same real hook returned syntax errors for an invalid JS edit in 659 ms, then returned empty diagnostics after the fix in 683 ms. Thus diagnostic-set changes are published and processed; repeated empty sets are the failing case.
Evidence
- Installed plugin metadata: OMO
5.1.40, bundled daemon0.1.0;npm view oh-my-openagent version dist-tags.latest --jsonreports latest5.1.40, so no newer supported host release was available. - Raw TypeScript LSP protocol probe on a project JS file:
didOpenpublished[]; afterdidChangeto a different valid source with the same empty diagnostics, no newpublishDiagnosticsarrived within 10 seconds. - That probe explicitly advertised
textDocument.publishDiagnostics.versionSupport: true; the notification was still suppressed. - A
workspace/executeCommandusing the documentedtypescript.tsserverRequestcommand forsyntacticDiagnosticsSyncandsemanticDiagnosticsSyncreturnedbody: []for the edited snapshot in about 1.2 seconds. - TypeScript Language Server v6.0.2 source confirms the behavior in
src/diagnosticsManager.ts:FileDiagnostics.updatereturns early when the previous and new diagnostic arrays for a category are both empty (lines 29-36), independent of client capabilities: source at v6.0.2. - OMO's published daemon bundle shows the waiting side:
resolvePushDiagnosticsand generation checks, and the push-only timeout path. - Raw hook and protocol captures are retained locally at
/tmp/merge-gate-repair-trigger-evidence/active-worktree-hook-roundtrip.json,active-diagnostic-transition.json, andsyncdiag-probe.json.
Root Cause
For a client without pull diagnostics, OMO treats a diagnostics snapshot as current only if it receives a publish at or after the document generation. TypeScript Language Server suppresses a repeated empty diagnostic category before publishing. After a successful initial empty publish, a later edit that keeps the diagnostics empty increments OMO's document generation but not its publish generation; with pull unsupported, the daemon waits until its 3000 ms deadline and reports a freshness timeout. Advertising versionSupport cannot help: TSLS's duplicate-empty early return does not inspect that capability, and the raw probe reproduced the timeout with it enabled.
Proposed Fix
Add a current-snapshot path for TypeScript Language Server when pull diagnostics are unsupported, using its advertised/documented typescript.tsserverRequest command with syntacticDiagnosticsSync and semanticDiagnosticsSync; map and combine those results for the current document version before returning. Do not treat a stale pre-edit publish as current or assume unchanged diagnostics without a fresh result. Implement this in the underlying OMO LSP daemon/core source and regenerate the bundled distribution rather than patching generated dist files alone.
Verification Plan
- Regression: valid JS, then at least two content-only edits that keep diagnostics empty; each real PostToolUse invocation returns empty diagnostics without a freshness timeout.
- Error transition: valid JS → syntax error → repaired JS; the error appears on the broken edit and clears on repair.
- Existing behavior: a server with pull diagnostics continues to use versioned current-snapshot results; verify diagnostic errors are neither dropped nor stale.
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 246
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của code-yeongyu/lazycodex
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
code-yeongyu/lazycodex#170 ·
-
Fix Codex browser QA routing before standalone PlaywrightCó thể đã có người làm @berkshirehathaways đã nhận 83 ngày trước. Đang mở
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 72/100
code-yeongyu/lazycodex#148 ·
-
[5.0.0-beta.78] High cost and rapid quota consumption: use role-appropriate agent model defaultsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
code-yeongyu/lazycodex#166 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
code-yeongyu/lazycodex#163 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
code-yeongyu/lazycodex#158 ·
Tất cả issue của code-yeongyu/lazycodex
Issue tương tự
-
[Feature]: 建议导入源后,自动切换到新导入的源Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
lyswhut/lx-music-desktop#3026 ·
-
area: ci type: test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
schlessera/brain-kit#2769 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Read a vector index's quantization back on Neo4j 2026.10, which reports vector.quantization.typeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine#231 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
alveusgg/alveusgg#2502 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày