Skip to content

fix: resolve verified issue triage regressions - #841

Closed
1jehuang wants to merge 11 commits into
masterfrom
agent/triage-2026-08-07-pr
Closed

fix: resolve verified issue triage regressions#841
1jehuang wants to merge 11 commits into
masterfrom
agent/triage-2026-08-07-pr

Conversation

@1jehuang

@1jehuang 1jehuang commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • route slash-prefixed models through matching OpenAI-compatible profiles
  • tolerate Windows 8.3 temporary paths during installer cleanup
  • restore remote Ctrl+K draft editing and cancellable rate-limit retries
  • meter API-key-backed compatible providers in the remote cost widget
  • keep multiline tool errors out of focused memory queries

Verification

  • exact jcode-base catalog and memory regression tests pass
  • exact jcode-tui billing, connected/disconnected Ctrl+K, and retry-cancellation tests pass
  • install.ps1 parses successfully in PowerShell
  • clean branch diff and worktree checks pass

Fixes #840. Fixes #838. Fixes #832. Fixes #831. Fixes #826. Fixes #824.

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

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR improves remote provider routing, focused-memory formatting, remote draft editing, retry cancellation, billing display, installer cleanup, and platform integration. One blocking routing issue remains: when compatible-provider model catalogs overlap, a slash-prefixed model can be routed to a provider other than the one selected by the user.

Confidence Score: 3/5

Not merge-safe until slash-model routing gives the active remote provider precedence over global compatible-provider matches.

One verified P1 security finding remains: overlapping compatible-provider catalogs can route prompts to an unintended configured provider. The scoring table assigns a score of 3 to one security P1 finding.

Files Needing Attention: crates/jcode-base/src/provider/catalog_routes.rs

Security Review

A configured but unselected OpenAI-compatible provider can receive a user prompt when it appears earlier in the compatible-provider catalog and advertises the same slash-prefixed model as the selected provider.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding and linked it to the review comment.
  • T-Rex captured a focused Rust overlapping-provider reproduction source to demonstrate the reproduction approach.
  • T-Rex added a reproduction harness dependency manifest to enable repeatable runs of the overlapping-provider test.
  • T-Rex included the current-provider helper output for the overlapping catalog to document the working reproduction.
  • T-Rex included the fallback output for the overlapping catalog to provide a comparison point for results.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
### Issue 1
crates/jcode-base/src/provider/catalog_routes.rs:892-897
**Selected compatible provider is ignored for overlapping slash models**

For slash-prefixed models, this branch resolves `remote_openai_compatible_route_for_model(model)` globally and returns its first catalog match before considering `remote_provider_name`. When two configured compatible providers advertise the same model, the fallback can send the request and its prompt to a provider the user did not select. Resolve `remote_current_openai_compatible_route_for_model(remote_provider_name, model)` first, and use the global compatible-profile lookup only when the selected provider cannot serve the model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (4): Last reviewed commit: "fix(ci): compile macOS notification brok..." | Re-trigger Greptile

Comment on lines +892 to +897
if model.contains('/')
&& let Some(route) = remote_openai_compatible_route_for_model(model)
{
routes.push(route);
continue;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Profile order overrides selection

When two configured OpenAI-compatible profiles advertise the same slash-prefixed model, this fallback performs the global compatible-profile lookup before checking the selected provider. With Baseten listed before the selected Hugging Face profile, a request for zai-org/GLM-4.7 routes to Baseten instead of Hugging Face. Prefer remote_current_openai_compatible_route_for_model(remote_provider_name, model) before the global lookup, retaining the global lookup only when the current provider cannot validate the model.

Artifacts

Failure-path reproducer with Baseten first and Hugging Face selected second

  • This authored Rust source configures both compatible profiles and invokes the exact fallback path, establishing the ordered-profile scenario.

Fallback output routes selected Hugging Face model to Baseten

  • The executed `cargo run` capture exits 0 and shows the fallback chose Baseten, proving the incorrect endpoint selection.

Selected-provider comparison reproducer for Hugging Face

  • This authored Rust source uses the same profiles and model but invokes the selected-profile resolver that the fallback should prefer.

Selected-provider resolver output routes model to Hugging Face

  • The executed `cargo run` capture exits 0 and shows Hugging Face, establishing the expected selected-provider route.

Existing focused Rust test output

  • The focused existing test command exits 0, but reports zero matching tests due to its non-module-qualified filter and therefore does not prove the required two-profile order scenario.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/provider/catalog_routes.rs
Line: 892-897

Comment:
**Profile order overrides selection**

When two configured OpenAI-compatible profiles advertise the same slash-prefixed model, this fallback performs the global compatible-profile lookup before checking the selected provider. With Baseten listed before the selected Hugging Face profile, a request for `zai-org/GLM-4.7` routes to Baseten instead of Hugging Face. Prefer `remote_current_openai_compatible_route_for_model(remote_provider_name, model)` before the global lookup, retaining the global lookup only when the current provider cannot validate the model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +892 to +896
if model.contains('/')
&& let Some(route) = remote_openai_compatible_route_for_model(model)
{
routes.push(route);
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Profile order overrides selection

For slash-prefixed models, this branch performs the global compatible-profile lookup before checking the provider selected for the current remote session. When Baseten and Hugging Face both advertise zai-org/GLM-4.7, with Hugging Face selected, the lookup returns Baseten because it appears first in the catalog. Check remote_current_openai_compatible_route_for_model(remote_provider_name, model) first, and use the global lookup only when the selected provider cannot validate the model.

Artifacts

Focused duplicate-profile routing test source

  • This preserved authored test configures Hugging Face and Baseten for the same slash model while selecting Hugging Face, with the takeaway that the expected selected-provider route is explicitly asserted.

Focused duplicate-profile routing test output

  • This captured cargo test output shows the selected Hugging Face route resolving to Baseten and the assertion failing, with the takeaway that the provider override remains reproducible.

Working tree restoration check

  • This captured git diff and status check confirms no tracked source changes remain after removing the focused test-only modification, with the takeaway that the working tree source is restored.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/provider/catalog_routes.rs
Line: 892-896

Comment:
**Profile order overrides selection**

For slash-prefixed models, this branch performs the global compatible-profile lookup before checking the provider selected for the current remote session. When Baseten and Hugging Face both advertise `zai-org/GLM-4.7`, with Hugging Face selected, the lookup returns Baseten because it appears first in the catalog. Check `remote_current_openai_compatible_route_for_model(remote_provider_name, model)` first, and use the global lookup only when the selected provider cannot validate the model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +892 to +897
if model.contains('/')
&& let Some(route) = remote_openai_compatible_route_for_model(model)
{
routes.push(route);
continue;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Selected compatible provider is ignored for overlapping slash models

When two configured OpenAI-compatible providers advertise the same slash-prefixed model, this global lookup returns the first catalog match before the selected remote provider is considered. For example, selecting OpenCode Go while both OpenCode Go and OpenCode Zen advertise shared/vendor-model routes the request to OpenCode Zen. This can send prompts to a provider the user did not select. Resolve remote_current_openai_compatible_route_for_model(remote_provider_name, model) first for slash models, then use the global compatible-profile lookup only if the selected provider cannot serve that model.

Artifacts

Rust reproduction fixture for selected OpenCode Go with duplicate slash model

  • The fixture configures two compatible profiles with the same slash model and requests the OpenCode Go route, ending with the takeaway: it directly reproduces the provider-selection defect.

Captured failed provider-routing reproduction output

  • The captured cargo run reports selected OpenCode Go but actual OpenCode Zen and exits 101, ending with the takeaway: current fallback routing selects the first global profile instead of the requested provider.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/provider/catalog_routes.rs
Line: 892-897

Comment:
**Selected compatible provider is ignored for overlapping slash models**

When two configured OpenAI-compatible providers advertise the same slash-prefixed model, this global lookup returns the first catalog match before the selected remote provider is considered. For example, selecting OpenCode Go while both OpenCode Go and OpenCode Zen advertise `shared/vendor-model` routes the request to OpenCode Zen. This can send prompts to a provider the user did not select. Resolve `remote_current_openai_compatible_route_for_model(remote_provider_name, model)` first for slash models, then use the global compatible-profile lookup only if the selected provider cannot serve that model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +892 to +897
if model.contains('/')
&& let Some(route) = remote_openai_compatible_route_for_model(model)
{
routes.push(route);
continue;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Selected compatible provider is ignored for overlapping slash models

For slash-prefixed models, this branch resolves remote_openai_compatible_route_for_model(model) globally and returns its first catalog match before considering remote_provider_name. When two configured compatible providers advertise the same model, the fallback can send the request and its prompt to a provider the user did not select. Resolve remote_current_openai_compatible_route_for_model(remote_provider_name, model) first, and use the global compatible-profile lookup only when the selected provider cannot serve the model.

Artifacts

Focused Rust overlapping-provider reproduction source

  • The authored isolated Rust test writes matching catalogs for OpenCode Zen and OpenCode Go, invokes the exact helpers and fallback builder, and asserts the divergent routes, proving the current behavior.

Reproduction harness dependency manifest

  • The authored manifest records the focused harness dependencies used to compile against the current repository library, making the reproduction setup inspectable.

Current-provider helper output for overlapping catalog

  • The executed baseline test passed and printed that the OpenCode Go current-provider helper returns `openai-compatible:opencode-go`, establishing the route expected from the active provider.

Fallback output for overlapping catalog

  • The executed fallback test passed and printed global and fallback routes as OpenCode Zen while the current-provider route was OpenCode Go, demonstrating that the fallback preempts the active provider.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/provider/catalog_routes.rs
Line: 892-897

Comment:
**Selected compatible provider is ignored for overlapping slash models**

For slash-prefixed models, this branch resolves `remote_openai_compatible_route_for_model(model)` globally and returns its first catalog match before considering `remote_provider_name`. When two configured compatible providers advertise the same model, the fallback can send the request and its prompt to a provider the user did not select. Resolve `remote_current_openai_compatible_route_for_model(remote_provider_name, model)` first, and use the global compatible-profile lookup only when the selected provider cannot serve the model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@1jehuang

1jehuang commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #842, which merged these six verified issue fixes into master. Closing this now-redundant PR to avoid duplicate changes.

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

@1jehuang 1jehuang closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment