Add update_config write path (TWS 10.44 / server 221)#708
Merged
Conversation
Fluent Client::update_config() (sync + async) returning an UpdateConfigBuilder to push partial config edits back to the gateway. - Builder: .api()/.orders()/.lock_and_exit()/.message()/.accept_warning()/ .reset_api_order_sequence() -> .submit(); generic over client, per-feature submit() in sync_impl/async_impl (rule 12). - Reuses the read-path domain types as write input (Option fields + Default). - Domain->proto encoders mirror the proto->domain decoders; new UpdateConfigResponse + ConfigWarning domain types. - Features::UPDATE_CONFIG gate (server 221); UpdateConfigResponse registered in text_request_id_field so it routes by request_id. - One-shot request/response (no library re-submit loop); caller echoes warnings via .accept_warning() to proceed, mirroring C# EClient.updateConfig. - Field-minimal testdata builder; 100% coverage on the new code. Live smoke test deferred: the write path mutates gateway settings.
Closes the Vec-vs-singular composability gap so a caller can round-trip Config.messages / UpdateConfigResponse.warnings in one call (precedent: MarketDataBuilder generic_ticks + add_generic_tick).
Bring the async request-body test to full parity with the sync mirror (adds lock_and_exit + per-element assertions); trim the sync response-decode test to the wiring-critical fields since exhaustive proto->domain mapping is owned by the decoder unit test.
wboayue
added a commit
that referenced
this pull request
Jul 17, 2026
* Add Order.deactivate field (TWS 10.48) Since TWS 10.48, reqOpenOrders returns de-activated orders. Surface Order.deactivate (bool) so callers can distinguish inactive orders from active ones. - Public Order.deactivate field + Default. - Map both directions in proto encoders/decoders (some_bool / unwrap_or_default), matching the C# EDecoderUtils/EClientUtils round-trip. No server-version gate (Order.Deactivate predates the proto floor). - Encode + decode unit tests; CHANGELOG Added. Also prune completed C#-sync plan files (PRs #705/#706/#707/#708 shipped) and refresh plans/csharp-sync-coverage.md. * Fill PR number in changelog (#709)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Option 2 of the config feature — the
update_configwrite path (IBKR added it in TWS 10.44). Adds a fluentClient::update_config()(sync + async) that pushes partial edits to the running gateway's configuration and returns anUpdateConfigResponsereporting changed fields, errors, and warnings.Follows PR #707 (the read path); reuses the read-path domain types as the write-side input.
API shape
Fluent builder (chosen over a struct-input form), matching the house style:
Semantics
This is a one-shot request → one-shot response — there is no library-level re-submit loop (confirmed against C#
EClient.updateConfigand the PythonConfigSamples). If the response'swarningsare non-empty the edit was not applied; the caller re-submits the same edit with each warning echoed via.accept_warning(...)to proceed. That acknowledgement round-trip is application-level, so the library stays a thin one-shot.What's included
UpdateConfigBuilder<'a, C>(src/config/builder/): generic over the client type, feature-agnostic setters, per-featuresubmit()insync_impl.rs/async_impl.rs— the established dual-feature builder pattern (rule 12, mirrorsOrderBuilder).ApiConfig,ApiSettings,OrdersConfig,LockAndExit,MessageSetting) as write input — allOptionfields withDefault, so partial edits are..Default::default().UpdateConfigResponse { status, message, changed_fields, errors, warnings }andConfigWarning.config/common/encoders.rs) mirror the read path's proto→domain decoders; decoder forUpdateConfigResponse.Features::UPDATE_CONFIG(server 221);UpdateConfigResponseregistered intext_request_id_fieldso it routes by request_id (rule 17).Cargo.toml;CHANGELOG.mdentry.Tests drive the real client API and verify the captured wire request by decoding
proto::UpdateConfigRequestfrom the sent bytes (rule 10), plus response decode, server-version rejection, and empty-stream paths.Verification
cargo fmt; clippy ×3 configs (-D warnings); rustdoc ×3 configs (-D warnings); sync + async doc-tests.update_configmutates gateway settings, so it was not run against the live paper gateway.