Skip to content

xbbg 1.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jun 00:20
· 1 commit to main since this release

Added

  • Async JavaScript Bloomberg connection factories: @xbbg/core now exposes Engine.connect() and top-level connect() so Bloomberg session startup runs off the Node event loop; the existing synchronous constructor remains available for compatibility.
  • Dedicated Bloomberg capacity-limit exceptions: JavaScript now exports BlpLimitError, and Python now exports xbbg.BlpLimitError, for Bloomberg LIMIT / DAILY_CAPACITY_REACHED responses.
  • @xbbg/langgraph cancellation and timeout safety: Tools now honor the LangChain/LangGraph AbortSignal — already-cancelled calls never start Bloomberg work and aborted snapshot tools stop collecting and unsubscribe immediately instead of running out their timeout. Lazily connected engines apply a default hard per-request timeout (DEFAULT_ENGINE_REQUEST_TIMEOUT_MS, 60s; engineConfig.requestTimeoutMs overrides, 0 disables) so a wedged Terminal session cannot hang tool calls forever. The new ToolInvocationConfig type is exported for custom tool integrations.

Changed

  • Bloomberg request workers use SDK push-mode sessions by default: The Rust async engine now creates callback-mode Bloomberg sessions, sends requests directly from submitting tasks, and routes pushed SDK events by generation-tagged correlation IDs. This removes the 1ms command-queue poll loop for request dispatch while preserving multi-worker request pools, request cancellation, service-open coalescing, timeout scanning, and safe shutdown ordering.
  • Rust hot paths tightened for high-throughput Bloomberg workloads: Request setters now use interned Bloomberg Name handles instead of allocating field-name C strings, release builds optimize for speed, field/exchange caches avoid stale disk entries, Arrow extraction avoids unchecked row/string access, and iterator/error paths now fail closed on Bloomberg SDK return codes.
  • @xbbg/langgraph extension schemas are strict discriminated unions: All xbbg_ext_* tool schemas now publish per-operation required fields to the model (with unknown-key rejection) instead of flat all-optional objects policed by runtime errors, and recoveryRate is validated as a 0-1 decimal. Snapshot tools report cleanup failures in a new unsubscribeError result field instead of discarding collected updates, empty results carry verification guidance in the model-facing summary, and binary payloads are bounded as placeholders instead of serialized raw.
  • @xbbg/langgraph security identifier guidance rewritten as pass-through rules: Agent instructions and every securities/ticker field description now state that securities are passed exactly as the user supplied them — Bloomberg tickers as <TICKER> <MARKET_SECTOR>, raw ISINs as /isin/<ISIN>, raw CUSIPs as /cusip/<CUSIP> — and that the ticker format is a template, never authorization to invent, recall, or guess a ticker for an identifier. The guidance now enumerates the Bloomberg market sector (yellow key) vocabulary — Equity, Index, Curncy, Comdty, Corp, Govt, Muni, Mtge, M-Mkt, Pfd — and documents that xbbg_ext_ticker.parse_ticker only handles generic futures-style tickers. Ticker-only recipe tools (xbbg_preferreds, xbbg_corporate_bonds, xbbg_index_members, xbbg_etf_holdings) direct the model to resolve identifiers through xbbg_resolve_isins first, and xbbg_preferreds explicitly takes the issuer's common equity ticker rather than a fabricated Pfd ticker. This removes the ambiguous "do not pass raw ISIN" phrasing that nudged models into inventing tickers instead of sending /isin/<ISIN>.
  • @xbbg/langgraph request schemas only advertise parameters the engine accepts: format is removed from the xbbg_bds, xbbg_bql, xbbg_bsrch, xbbg_bflds, and xbbg_beqs tool schemas because the engine rejects it for BulkData, Bql, Bsrch, FieldInfo, and BEQS output ("format is not supported for ... output"); model-sent values are stripped instead of forwarded, while xbbg_bdp/xbbg_bdh keep their supported format options. Date inputs are now JSON-representable end to end: z.date() is dropped from the wire unions (zod v4's toJSONSchema throws "Date cannot be represented in JSON Schema"), with strings and epoch/YYYYMMDD numbers covering all tool calls. A new toolParameterJsonSchema(tool) export returns the provider-ready $ref-free JSON Schema so consumers stop reinventing zod conversion, and the agent instructions now direct one call per dataset instead of parallel parameter probing.

Fixed

  • Bloomberg top-level responseError payloads are surfaced consistently: Refdata, historical, bulk, generic, intraday, BQL, field-info, and search extractors now propagate Bloomberg responseError details such as category=LIMIT, code=-4001, and subcategory=DAILY_CAPACITY_REACHED instead of returning empty successful batches or generic request failures.
  • Binding error mapping preserves Bloomberg failure classes: NAPI and PyO3 now translate Bloomberg limit responses into the new limit exception classes while keeping validation, timeout, cancellation, session, and generic request errors distinct.
  • Rust Bloomberg SDK ownership and entitlement handling hardened: Identity handles are released correctly, entitlement checks now preserve the SDK boolean result, Session::next_event maps non-timeout SDK failures to errors, and async session shutdown waits for Bloomberg callbacks to drain before dropping callback state.
  • @xbbg/langgraph numeric dates no longer collapse to 1970: Integer YYYYMMDD inputs (e.g. 20240131) are parsed as calendar dates instead of epoch milliseconds, ambiguous numeric dates are rejected, and date/override normalization failures now surface as actionable schema messages to the model instead of LangChain's generic schema-mismatch text. Concurrent tool calls sharing one failed connect no longer cross-contaminate each other's error prefixes by mutating the shared Error.

Full Changelog: v1.2.7...v1.3.0