Skip to content

fix: automated triage batch (563, 565, 572, 573, 577, 578) - #580

Merged
1jehuang merged 14 commits into
masterfrom
triage/2026-07-24-batch
Jul 25, 2026
Merged

1jehuang merged 14 commits into
masterfrom
triage/2026-07-24-batch

Conversation

@1jehuang

Copy link
Copy Markdown
Owner

Automated triage batch: five low-risk, verified fixes for open issues.

Issue Fix
#572 format_tools(is_oauth=true) now only advertises a curated Claude-Code builtin when its backing registry tool is actually registered, so Agent/Glob are no longer advertised after subagent/glob removal.
#573 jcode-pdf::extract_text wraps pdf_extract in catch_unwind and returns a normal error; format_comm_context_history truncates on char boundaries instead of byte indices.
#565 OpenRouter SSE parser splits on \r\n\r\n as well as \n\n, and keeps every data: line instead of only the last one (silent content loss).
#577 Kimi K3 (k3, kimi-k3) resolves to 1,048,576 tokens globally; k3-256k to 262,144; K2 keeps 256K.
#578 The Anthropic runtime overrides context_window() to use the cache-aware lookup, so a live catalog limit for a model missing from the static override table reaches the TUI meter and compaction budget.

| #563 | LaTeX render failures are remembered in a bounded negative cache, so a failing snippet no longer respawns latex/pdflatex on every redraw and freezes the TUI. |

Verification:

  • cargo test -p jcode-provider-anthropic 8 passed
  • cargo test -p jcode-provider-openrouter 20 passed
  • cargo test -p jcode-provider-core 106 passed
  • cargo test -p jcode-protocol 74 passed, cargo test -p jcode-pdf 1 passed
  • cargo test -p jcode-tui-markdown 134 passed
  • cargo check --workspace --all-targets clean

Each fix ships a regression test. Thanks to @vietgs03, @wtry, @wiktorwiesek, @ravshansbox, and @dmt4 for the detailed reports and root-cause pointers.


— Jcode agent (automated triage), on behalf of @1jehuang

@1jehuang

Copy link
Copy Markdown
Owner Author

CI note: the Format and Quality Guardrails failures here are pre-existing on master, not introduced by this branch. cargo fmt --all --check reports the same 27 diffs on master (jcode-desktop2, jcode-fuzzy, jcode-harness-api*, and some jcode-tui files) as on this branch, with an identical file set. This is the same class of red CI tracked in #547.

Verified locally for this branch specifically:

  • every file touched here passes rustfmt --check
  • all six ratchets (code size, test size, panic, swallowed error, wildcard re-export, dependency boundaries) produce output identical to master; the Anthropic SSE types and context-window resolution were extracted into their own modules, and the LaTeX failure-cache mutex recovers from poisoning, specifically to avoid growing the code-size and swallowed-error budgets
  • cargo check --workspace --all-targets clean, 391 tests passing across the touched crates

— Jcode agent (automated triage), on behalf of @1jehuang

@1jehuang

Copy link
Copy Markdown
Owner Author

Opened #581 to fix the underlying formatting drift on master (a pure cargo fmt --all run, no logic changes). Once that lands, rebasing this branch should turn Format and Quality Guardrails green here.


— Jcode agent (automated triage), on behalf of @1jehuang

1jehuang added 8 commits July 24, 2026 13:45
Extract Anthropic SSE response types into sse_types.rs and context-window
resolution into context_window.rs so lib.rs does not grow past the
oversized-file ratchet, and recover the LaTeX failure-cache mutex instead of
swallowing the poisoned-lock error.
@1jehuang
1jehuang force-pushed the triage/2026-07-24-batch branch from b363d2f to 32d5d78 Compare July 24, 2026 20:47
1jehuang added 6 commits July 24, 2026 13:50
jcode sent max_tokens=32768 for every Claude model. Opus 5, Opus 4.6-4.8,
Sonnet 5/4.6, and Fable 5 all allow 128K output on the synchronous
Messages API, and adaptive-thinking models spend that budget on thinking
plus the visible tool call. The flat cap therefore truncated turns
mid-tool-call and silently ended long agentic runs.

Found while benchmarking Opus 5 on jcode bench: 4 of 23 turns ended at
exactly 32768 output tokens and the agent stopped after 50 minutes of a
20-hour budget, producing only 3 grades where Opus 4.8 produced 41.

JCODE_ANTHROPIC_MAX_TOKENS still overrides, and unknown/older models keep
the conservative 32K budget.
… fixes

- comm_format: use a probe whose byte index 500 strictly straddles a code
  point, so the multibyte tests fail against the old byte-slicing version.
- latex_image: count real toolchain spawns via a stub that logs each
  invocation, asserting 50 redraws after a failure spawn it zero extra times
  (the actual #563 symptom).

Each fix in this branch was mutation-checked: reverting the fix makes its
tests fail, and restoring it makes them pass.
Intent is a property of the request, not of one todo group. Replace the
per-goal user_intention/alignment_score/objective fields with one
plan-level TodoPlan { user_intention, understands_user_intent } that
covers the whole todo list, persisted alongside todos and goals.

- goals keep only hill_climbability, feedback_loop, end_to_end_ownership
- the intent gate now fires once per write while any todo is open
- serde aliases keep older alignment_score payloads readable
- TUI card and side panel render plan intent once, above the groups
@1jehuang
1jehuang merged commit 703ab0a into master Jul 25, 2026
20 of 21 checks passed
@1jehuang
1jehuang deleted the triage/2026-07-24-batch branch July 27, 2026 05:43
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