Skip to content

v0.9.0-beta.8: IBKR stability, aliceId enforcement, trailing stop fix#88

Merged
luokerenx4 merged 3 commits intomasterfrom
dev
Mar 26, 2026
Merged

v0.9.0-beta.8: IBKR stability, aliceId enforcement, trailing stop fix#88
luokerenx4 merged 3 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Copy Markdown
Contributor

Summary

  • IBKR account subscription cache — replace request-response reqAccountUpdates round-trips with persistent subscription. Eliminates timeout cascades and unhandled rejection crashes after tradingPush
  • aliceId pipe format enforced — all code/tests unified to accountId|nativeKey format. stagePlaceOrder now throws on invalid format instead of silently creating empty contracts
  • trailingAmount → trailStopPrice — was incorrectly mapped to auxPrice (conflicting with stopPrice), now correctly maps to order.trailStopPrice
  • README, IBKR broker docs, version bump to beta.8

58 commits since last merge.

Test plan

  • pnpm test — 915 tests pass
  • pnpm test:e2e — 34 passed, 18 skipped (broker-specific)
  • Smoke test trailing stop order via IBKR paper
  • Confirm snapshot no longer crashes after tradingPush

🤖 Generated with Claude Code

Ame and others added 3 commits March 26, 2026 07:42
…scription cache

reqAccountUpdates was being used in subscribe→collect→unsubscribe
round-trips on every getAccount/getPositions call. When TWS was slow
(e.g. after tradingPush), timeouts cascaded and the lock's derived
Promise rejected without a handler, crashing the process.

Now subscribes once on init(), maintains a double-buffered cache that
updates on each accountDownloadEnd callback. getAccount/getPositions
read from cache synchronously — no network round-trip, no lock, no
timeout, no unhandled rejection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
stagePlaceOrder/stageClosePosition now throw on invalid aliceId instead
of silently creating an empty Contract (which caused TWS to reject with
"invalid security type"). Updated all test fixtures from old hyphen
format (mock-AAPL) to pipe format (mock-paper|AAPL). Tool descriptions
now document the expected format explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
trailingAmount and stopPrice were both assigned to order.auxPrice,
causing the last write to overwrite the other. IBKR Order has a
dedicated trailStopPrice field for trailing stop offsets.

Added tests for trailing stop amount, percent, and the case where
both stopPrice and trailingAmount are set simultaneously.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit 06345e1 into master Mar 26, 2026
2 checks passed
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.

1 participant