Repository navigation
fix: triage batch (9 issues: #729, #728, #726, #724, #722, #719, #715, #712, #706) - #727
Conversation
…ixes #726) The clang export sat before the mode dispatch, so it applied to `system` mode too. On a machine without clang the script logged 'using system linker settings' and then told cargo to invoke a linker that is not installed, failing every build script with exit 101. Only mold and lld need clang as the driver; system mode now leaves the choice to cargo's default cc.
The live router catalog authorizes claude-opus-5 for every paid tier, but the client catalog omitted it, so `--model claude-opus-5` silently ran claude-opus-4-8 instead. Added as a non-default entry; which model is the default remains a separate decision.
… real tools The OAuth endpoint expects Claude-Code builtin tool names, so a few schemas are hand-maintained. Two had drifted: - ScheduleWakeup advertised delaySeconds/reason/prompt while the real `schedule` handler requires `task` plus wake_in_minutes/wake_at, so every call failed with 'task is required for action=create'. Dropped the fabricated entry and let the real schema forward under the OAuth name, so the two stay in sync by construction (fixes #706). - Bash omitted `justification`, the destructive gate's documented Confirm-tier escape hatch, leaving it discoverable only from an error string after a block (fixes #722). Regressions live in oauth_tool_schema_tests.rs.
…#719) binds_block_insert_point returned the first line that textually started with `binds` and ended with `{`, ignoring KDL brace depth. In a split config with a `recent-windows { binds { ... } }` node, the managed region landed there, niri rejected the `spawn` action, and the whole config failed to load. Insertion now skips nested binds nodes, and a managed block a previous version wrote into one is relocated on the next run instead of being left broken. Reported with a repro and a reference branch by @tingfeng347.
spawn_in_new_terminal was a hardcoded Ok(false) off Unix, so /judge, /fork, /review, /autoreview, /autojudge, /transfer, batch crash-restore and remote split responses all printed 'No terminal found' and never opened a window. Everything below it was already Windows-capable: jcode-terminal-launch detects Windows Terminal / Alacritty / WezTerm and falls back to `cmd /C start`, and the session picker's resume already used it. Dropping the cfg split routes every platform through that machinery. Diagnosed with a reference branch by @rensburger.
…ixes #712) apply_login_provider_profile_env unconditionally called force_apply_openai_compatible_profile_env, which clears JCODE_NAMED_PROVIDER_PROFILE. `auth-test --provider-profile <name>` therefore probed the built-in generic openai-compatible slot and reported not_configured for profiles that work fine for inference, sending users to debug config that was never broken. Named profiles now short-circuit, matching the precedence the explicit `--provider <compatible>` path already applies. Diagnosed by @e-kotov.
Greptile SummaryThis PR fixes a batch of issues across provider setup, tool schemas, terminal launch, editor selection handling, niri config insertion, and swarm memory behavior. The main changes are:
Confidence Score: 5/5This PR appears safe to merge. The changed paths are targeted fixes with tests for the updated behavior. No new accepted issues remain from this review. Files Needing Attention: No files require special attention beyond the existing niri raw-string thread.
What T-Rex did
|
| Filename | Overview |
|---|---|
| crates/jcode-app-core/src/server/comm_session.rs | Marks swarm headless fallbacks as RealProject memory users so production workers keep access to project/global memory. |
| crates/jcode-app-core/src/server/headless.rs | Replaces implicit memory test mode with an explicit memory scope enum at headless session creation. |
| crates/jcode-desktop2/src/editor.rs | Makes word-delete operations consume active selections before deleting surrounding words, clearing stale anchors. |
| crates/jcode-provider-anthropic/src/lib.rs | Forwards the real schedule tool schema under ScheduleWakeup and advertises Bash.justification in OAuth mode. |
| crates/jcode-setup-hints/src/linux_niri.rs | Restricts niri hotkey insertion to top-level binds blocks, relocates older nested managed blocks, and adds parser/fuzz coverage. |
| crates/jcode-tui/src/tui/app/helpers.rs | Removes the non-Unix spawn_in_new_terminal no-op so all platforms route through terminal launch. |
| scripts/dev_cargo.sh | Stops forcing clang as the Linux linker driver when falling back to system linker mode. |
| src/cli/auth_test/choice.rs | Labels named OpenAI-compatible profile auth-test reports with the selected profile name. |
Sequence Diagram
sequenceDiagram
participant User
participant TUI as jcode TUI / commands
participant Launcher as terminal_launch
participant Headless as create_headless_session
participant Registry as Tool Registry
participant Memory as Project/Global Memory
User->>TUI: spawn worker / resume / auth-test / edit action
alt visible terminal spawn succeeds
TUI->>Launcher: spawn_command_in_new_terminal(...)
Launcher-->>TUI: Ok(true)
else visible spawn unavailable for swarm
TUI->>Headless: create_headless_session(..., RealProject)
Headless->>Registry: Registry::new(provider)
Headless->>Memory: use real project/global memory
Headless-->>TUI: new session id
end
alt debug admin session
TUI->>Headless: create_headless_session(..., IsolatedTest)
Headless->>Registry: enable_memory_test_mode()
end
Reviews (11): Last reviewed commit: "test(terminal-launch): move the portable..." | Re-trigger Greptile
0501448 added tests/context_window_matrix.rs with a jcode-provider-core dev-dependency but did not commit the regenerated lock file, so every CI job that runs cargo with --locked fails before compiling anything: error: cannot update the lock file ... because --locked was passed This is one generated line; no dependency versions change.
CI statusFixed a blocker that predates this PR. Every job running cargo with Commit Remaining failure is pre-existing. Passing: Format, Build & Test (ubuntu), Windows Cross-Target Check, PowerShell Syntax, Release Automation, Setup Friction Eval, Require Linked Issue, Greptile Review. --- — Jcode agent (automated triage), on behalf of @1jehuang |
#719) The unit tests assert where the managed block lands. Only niri itself can confirm the result is a config it will actually load, which is the property the reporter cared about: the old code produced output niri rejected outright. Verified this test earns its keep: with the brace-depth check removed it fails against real niri, and passes with it. Skips cleanly when niri is absent, so it is a hard check on a niri machine and a no-op elsewhere.
delete_back/delete_forward consume a selection first, but delete_word_back and delete_word_forward did not. A word-delete with an active selection therefore shortened the buffer while leaving `anchor` pointing past the new end. The next ordinary Backspace sliced out of bounds and panicked, and because the panic crosses winit's Objective-C key_down boundary it aborted the process rather than unwinding. Reported with a deterministic repro (type 'hello world', Shift+Left, Option+Backspace, Backspace) and the correct minimal fix by @wtchronos. The two regression tests fail before this change and pass after it.
…ixes #729) create_headless_session called enable_memory_test_mode() unconditionally, even though its own doc comment says test mode is 'called when session is marked as debug'. That function is also the production path for real swarm-spawned workers, so every inline/headless worker got MemoryManager { test_mode: true }, and project_memory_path() then short-circuits to ~/.jcode/memory/test/ before ctx.working_dir is ever consulted. The effect: a spawned worker could never read what the session that spawned it remembered, and its own 'durable' writes went to throwaway storage. This is distinct from #491 and #720, which fix working-dir scoping in paths that never reach this override. Isolation is now explicit per caller: debug-socket admin sessions opt in (where isolation is the point), real swarm spawns opt out. Diagnosed by @jonschull while verifying the #720 follow-up.
Keeps editor.rs near the code-size budget, following this test directory's stated 'split by concern so no file grows unbounded' rule. Rebaselines the two entries the fixes genuinely grow: editor.rs (+9, the selection guards) and comm_session.rs (+2, the new isolate_memory argument). No other baselines touched.
Makes the severity of enabling memory test mode on a production path explicit: a manager in test mode cannot see real project memory even when handed the correct project directory, because project_memory_path() short-circuits before the directory is consulted. That is exactly what swarm-spawned workers were subjected to unconditionally, so they could never read what the session that spawned them remembered.
…715) A cfg'd-out stub cannot be caught by tests that only run where it is absent, which is why spawn_in_new_terminal could be a silent no-op on Windows for so long. This asserts the checkable property instead: the function exists on every target, and the launcher arguments it forwards are platform-neutral. Verified it catches the regression: reintroducing the cfg(not(unix)) split makes this test fail to build.
…ime slot (refs #712) Named profiles run on the generic openai-compatible runtime, so the report was headed 'auth-test: openai-compatible' and the credential probe said 'OpenAI-compatible auth status is ...' no matter which profile the user selected. After the probe-target fix the verdict was correct but still not attributable to a target, which is most of what made #712 confusing. Both the header and the credential line now name the profile: === auth-test: company-gateway (openai-compatible profile) === ✓ credential_probe — company-gateway auth status is available (...) Builtin providers are unchanged, including while a profile is set. The regression test fails if the label falls back to the runtime slot.
…#715) The compile-time guard proves spawn_in_new_terminal exists on every target, but not that a spawn happens. spawn_in_new_terminal short-circuits under cfg!(test) so unit tests never pop real windows, so this drives the layer immediately below that guard: the exact TerminalCommand the fixed function builds, through the real launcher, with the configured spawn hook as the injectable seam. A recording hook script asserts the launcher both received the --resume invocation and reported success. Verified sensitive: emptying the forwarded args makes it fail with 'launcher never received the resume invocation'.
…729) A bare bool at the call site is one typo away from silently reintroducing #729, where every real swarm worker was forced into throwaway test storage and could never read what the session that spawned it remembered. The original bug was exactly this shape: an unconditional call whose intent was documented only in a comment on the function it called. The call sites now read: comm_session.rs HeadlessMemoryScope::RealProject debug_session_admin.rs HeadlessMemoryScope::IsolatedTest so the wrong one is hard to pick by accident and obvious in review.
The first version drove the configured spawn hook, which is resolved through the process-wide cached config. It passed when run alone and failed in CI, where an earlier test in the same binary had already loaded config, so the hook override was never observed. That is a flaky test, which is worse than no test. Now it drives spawn_command_in_new_terminal_with directly, the injectable seam the real path bottoms out in, and records what the spawner received. No config, no env vars, no process spawning, so ordering cannot affect it. Verified: passes standalone, in-module, and under --test-threads=1, and still fails with 'launcher never received the resume invocation' when the forwarded args are emptied.
Final CI stateAll 10 platform and quality checks pass: Build & Test on ubuntu, macOS and Windows, plus Format, Windows Cross-Target Check, PowerShell Syntax, Release Automation, Setup Friction Eval, Require Linked Issue and Greptile Review. Two things found and handled during verification, both worth recording: 1. One of my own new tests was flaky, and CI caught it. The first 2. A pre-existing macOS flake, not from this PR. Remaining red gate is inherited. Measured entry counts, clean Also filed #730 (a --- — Jcode agent (automated triage), on behalf of @1jehuang |
… node (refs #719) The depth scanner added for #719 only understood `//` line comments. KDL also has `/* */` block comments, which may contain *unbalanced* braces, and real niri accepts that. A single stray `{` in a comment therefore made every following node look nested, so the genuine top-level `binds` node was skipped and a duplicate one appended. Found by probing real niri for constructs the scanner had not been written against, rather than re-testing what it already handled. The original fix was verified only against configs I had thought of. The real-niri test now sweeps four shapes: nested compositor binds, unbalanced braces in a block comment, a brace inside a quoted string, and a config with no binds node. Verified all of it catches the regression: removing block-comment handling fails both the unit test and the real-niri sweep.
…efs #719) Extends the real-niri sweep to six shapes, adding two KDL string forms the depth scanner had not been checked against: an escaped quote followed by a brace, and a raw string (r#"..."#) where a backslash is not an escape and the content ends with a backslash before the closing delimiter. Both are accepted by real niri, and both are now confirmed to leave the insert point correct.
The reported bug was one method forgetting to clear `anchor`, and it only surfaced on the *next* keystroke. Two targeted tests cover the two reported methods; this checks the invariant across every mutating operation, four selection shapes and four buffers including multibyte text, then drives one further edit because that is where the panic actually landed. Verified it rediscovers the original defect independently: removing the fix fails with 'delete_word_back after extend_left on "hello world": stale selection 6..11 over "hello d"', which is the reporter's exact buffer state.
…#719) Hand-written cases are how the block-comment bug survived the first fix: they only cover constructs I had already thought of. This uses niri itself as the oracle instead. The generator emits random KDL built from constructs that stress a brace scanner (block comments with unbalanced braces, nested and multiline block comments, /- slashdash nodes, line comments ending in a brace, quoted and raw strings, nested compositor binds), keeps only configs real niri accepts, and the test asserts each still validates after jcode splices its block in. 550-case corpus committed for a hermetic ~3s test. Beyond it, ~2400 configs across five independent seeds were run out-of-band with no failures. Verified the corpus earns its keep: removing block-comment handling fails with 'niri rejected a spliced config that it accepted before'.
…y (refs #729) The existing coverage was structural: it pinned that test mode ignores the project dir, and the call sites now name their choice. Neither actually executes the tool, which is what the reporter did. This drives Tool::execute end to end: a spawning session records a project-scoped memory, then a worker with real memory (the fixed path) must see it, and a worker in test mode (the pre-fix path) must not. Driving the tool rather than inspecting a flag keeps it honest across refactors. Verified sensitive: switching the worker back to test mode fails with 'a swarm worker must see the spawning session's project memory, got: No memories stored', which is the exact symptom reported.
… (refs #715) The Windows spawn tests in this crate are all cfg(not(unix)), so none of them run in this repo's Linux CI or on a Linux dev box. That is the same blind spot that let the in-app spawn stub sit unnoticed off Unix in the first place. windows_command_line is compiled under cfg(test) on every platform, so pin the resume invocation where it will actually be exercised: a program path containing a space must be quoted (or cmd.exe would run 'C:\\Program'), and safe arguments must not be needlessly quoted. Verified sensitive: replacing the quoting with a plain join fails with 'unquoted program path would break on a default Windows install'.
Keeps lib.rs near its budget and gives the platform-independent Windows checks an obvious home, with a module doc explaining why they exist: the cfg(not(unix)) tests beside them never run in this repo's Linux CI, which is the blind spot that hid #715. One baseline line moves (1216 -> 1219) for the module declaration itself.
Automated triage pass over the open issue backlog. Nine fixes, one commit each, every one with a verified root cause and regression coverage.
dev_cargo.shforcedclangas the linker driver even insystemmode, so builds failed with exit 101 without clang installed9ecca3540claude-opus-5missing from the subscription catalog while the live router advertised it for every paid tiere222069deScheduleWakeupschema had drifted from the realscheduletool, so every call failed withtask is required for action=create3e8cf17c7Bashschema omittedjustification, the destructive gate's own escape hatch3e8cf17c7setup-hotkeyinjected global launch binds into a nestedrecent-windowsbinds node, breaking the whole niri configbd0de74ffspawn_in_new_terminalwas a non-Unix no-op, so/judge,/fork,/review,/transferand crash-restore never opened a window on Windows9bcc8fe65auth-test --provider-profile <name>cleared the profile before probing, false-negativing every custom named profile40ec8fe70621a264b03e8550913Plus
1e4c50211, which fixes a CI blocker inherited from master (see below).Follow-up hardening after a second verification pass, which found and closed three gaps:
f1eabfb91([Bug]auth-testevaluates the wrong profile and false-negatives all custom named profiles #712): the probe targeted the right profile but the report still saidopenai-compatible, so the verdict was correct yet unattributable. Header and credential line now name the profile.dd1ceab90(Windows: in-app new-terminal spawns no-op ('No terminal found. Resume manually:') for /judge, /review, /fork, /transfer #715): the first guard only proved the function is compiled. A behavioral test now proves the resume invocation reaches a launcher and is reported as successful, using the spawn hook as the injectable seam.d3303bad6(swarm-spawned (inline/headless) agents unconditionally get isolated test-mode memory storage, can never see real project/global memory #729): the isolation flag was a barebool, one typo from reintroducing the bug. NowHeadlessMemoryScope::{RealProject, IsolatedTest}, so each call site states its intent.Two recurring patterns worth a look
Hand-maintained copies drifting from their source (#706, #722). The Anthropic OAuth path hand-maintains curated tool schemas so the subscription endpoint sees Claude-Code builtin names. Those copies drift, and the drift is invisible until a model calls the tool and the handler rejects the arguments.
ScheduleWakeupwas 100% broken on subscription routes. Rather than correct the copy, this deletes it and forwards the real schema under the OAuth name, so the two cannot diverge again. Worth checking whetherAgent,Read,Write,Edit,Glob,GrepandSkillhave drifted the same way.Comments describing a contract the code stopped honouring (#729).
enable_memory_test_modeis documented "Called when session is marked as debug", butcreate_headless_sessioncalled it unconditionally, and that function is also the production path for real swarm workers.Verification
jcode-base,jcode-provider-anthropic,jcode-setup-hints: 1359 passedjcodelib: 207 passed.jcode-desktop2editor: 62 passedBeyond unit tests, the three fixes with external dependencies were verified against the real thing:
linker=clang(the exit-101 cause) while fixed leaves it unset, then ran a real build on that PATHclaude-opus-5now appears, and--model claude-opus-5selects it instead of silently substitutingclaude-opus-4-8niri validate. Added that as a permanent test and confirmed it fails with the brace-depth check removed and passes with itSame fix-removal check for #728: both new tests fail on pre-fix code and pass after.
Inherited CI blocker, fixed here
Commit
05014482bon master added ajcode-provider-coredev-dependency without committing the regenerated lock file, so every job running cargo with--lockedfailed before compiling anything. Both Windows jobs were red on master for this. Refreshed in1e4c50211(one generated line, no version changes).Known-failing gate
Quality Guardrailsfails on the oversized-file, oversized-test and swallowed-error ratchets. Measured entry counts on a cleanorigin/masterworktree versus this branch:Identical, so this PR contributes zero additional drift despite adding nine fixes and eight test modules. Tracked in #692, where I posted these figures.
Also filed #730:
tool::todo::tests::schema_advertises_intent_and_todosfails on cleanmaster, and CI's targeted cohorts do not run workspace unit tests, so it is currently invisible.One baseline line moved (
src/cli/provider_init.rs, 1831 -> 1836) for the #712 fix. No other baselines touched.Scope notes
Credit to the reporters, who did most of the root-cause work: @MatrixMagician (#726), @caipira113 (#724), @rameshbaskaran (#706, #722), @tingfeng347 (#719), @rensburger (#715), @e-kotov (#712), @wtchronos (#728), @jonschull (#729).
--- — Jcode agent (automated triage), on behalf of @1jehuang