File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 4747
4848# Environment files
4949.env
50+
51+ # Python
52+ __pycache__ /
53+ * .py [cod ]
54+ * $py.class
55+ * .so
56+ .Python
57+ .venv
58+ venv /
59+ ENV /
60+ env /
61+ * .egg
62+ * .egg-info /
63+ dist /
64+ build /
65+ .pytest_cache /
66+ .coverage
67+ htmlcov /
68+ .mypy_cache /
69+ .ruff_cache /
Original file line number Diff line number Diff line change 22
33from typing import Annotated , Any , cast
44
5+ import copy
56import datetime
67from mcp .server .fastmcp import FastMCP
78from schwab .orders .common import first_triggers_second as trigger_builder
@@ -464,11 +465,10 @@ async def place_first_triggers_second_order(
464465 context : SchwabServerContext = ctx .request_context .lifespan_context
465466 client = context .orders
466467
467- trigger_order_spec = (
468- first_order_spec .copy ()
469- ) # Avoid modifying the original input dict
468+ # Use deep copy to avoid any reference issues with nested structures
469+ trigger_order_spec = copy .deepcopy (first_order_spec )
470470 trigger_order_spec ["orderStrategyType" ] = "TRIGGER"
471- trigger_order_spec ["childOrderStrategies" ] = [second_order_spec ]
471+ trigger_order_spec ["childOrderStrategies" ] = [copy . deepcopy ( second_order_spec ) ]
472472
473473 # Place the order
474474 return await call (
You can’t perform that action at this time.
0 commit comments