Skip to content

fix: apply quant bridge host rewrite and file mounts to selected environment - #691

Open
pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/live-deploy-brokerage-env-settings
Open

pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/live-deploy-brokerage-env-settings

Conversation

@pcbeingused333

Copy link
Copy Markdown

Fixes #690

Cause

LeanRunner only looked at the top level of the Lean config when rewriting quant-bridge-server-host (localhost/127.0.0.1 -> host.docker.internal) and when mounting transaction-log / quant-bridge-symbol-map-file. lean live deploy writes brokerage and live data provider settings under lean_config["environments"][<environment>], so neither step ever matched there.

Fix

Both the host rewrite (get_basic_docker_config, get_basic_docker_config_without_algo) and the file mounts (_mount_common_directories) now also apply to the selected environment's entries, through a small _get_config_scopes helper. If a file key is set both at the top level and in the environment, it is mounted once, using the environment's value. Top-level behavior is unchanged.

Tests

Added tests in tests/components/docker/test_lean_runner.py for the host rewrite (both localhost and 127.0.0.1) and the symbol map mount with the settings under the selected environment, plus a case with the key set in both places (single mount). They fail before the change and pass after it; the rest of tests/components/docker and tests/commands/live still pass.


This change was prepared with the assistance of an AI agent (Claude, by Anthropic).

pcbeingused333 and others added 2 commits October 31, 2026 06:32
…ronment

lean live deploy stores brokerage settings under lean_config["environments"][<env>],
so the top-level-only checks in LeanRunner never saw them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

lean live deploy skips the localhost host rewrite and symbol map mount for brokerage settings

1 participant