[Bug][Codex] Provider Gateway rebuild drops account concurrency settings

Author: sciman-topCreated Oct 1, 2026Updated Oct 1, 2026

Summary

Rebuilding a Provider Gateway collection drops the saved per-account concurrency settings.

apply_provider_gateway_template_settings copies most persisted gateway settings from the saved collection into the newly generated collection, but it currently omits:

  • max_account_concurrency (maxAccountConcurrency in the manifest)
  • account_concurrency_wait_ms (accountConcurrencyWaitMs in the manifest)

A rebuild therefore falls back to the defaults from new_empty_local_access_collection (0 / the default wait), even though the generated sidecar manifest already emits both fields. This is especially visible when a user sets a single-flight limit to avoid upstream 429 amplification and then Cockpit regenerates the sidecar.

Proposed fix

Copy both fields in apply_provider_gateway_template_settings and add a regression test that applies a non-default template and verifies the generated collection preserves both values.

The fix is independent of the Provider Gateway SSE Flush() work in #2658 / #2659; it does not change streaming code or retry defaults.

Validation

The focused Rust test target compiles successfully with:

cargo test --manifest-path src-tauri/Cargo.toml provider_gateway_template_preserves_account_concurrency_settings --lib --no-run

The local Windows test runner cannot start the Tauri test binary because of an existing 0xC0000139 / STATUS_ENTRYPOINT_NOT_FOUND WebView2/runtime DLL conflict; this is an environment launch failure rather than a test assertion failure.