{"record":{"id":"05b7276b64ba4bfe","repo":"nautechsystems/nautilus_trader","slug":"unsupported-ibordertags-field-field","errorCode":null,"errorMessage":"Unsupported IBOrderTags field: {field}","messagePattern":"Unsupported IBOrderTags field: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/transform/tags.rs","lineNumber":106,"sourceCode":"            apply_order_field_update(ib_order, &mut order_value, &field, value)?;\n        }\n    }\n\n    Ok(())\n}\n\nfn apply_order_field_update(\n    ib_order: &mut IBOrder,\n    order_value: &mut Value,\n    field: &str,\n    value: Value,\n) -> anyhow::Result<()> {\n    let Some(order_obj) = order_value.as_object_mut() else {\n        anyhow::bail!(\"Failed to apply IBOrderTags because IB order JSON is not an object\");\n    };\n\n    if !order_obj.contains_key(field) {\n        anyhow::bail!(\"Unsupported IBOrderTags field: {field}\");\n    }\n\n    let previous = order_obj.insert(field.to_string(), value);\n\n    match serde_json::from_value::<IBOrder>(order_value.clone()) {\n        Ok(updated_order) => {\n            *ib_order = updated_order;\n            Ok(())\n        }\n        Err(e) => {\n            let Some(order_obj) = order_value.as_object_mut() else {\n                anyhow::bail!(\n                    \"Failed to restore IB order JSON after invalid IBOrderTags field: {field}\"\n                );\n            };\n\n            match previous {\n                Some(previous) => order_obj.insert(field.to_string(), previous),","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/transform/tags.rs#L88-L124","documentation":"IBOrderTags overlays only allow fields that already exist on the serialized IBOrder (order_obj.contains_key(field)). Setting a field IBOrder does not define is rejected so the tag map cannot inject unknown fields into the order.","triggerScenarios":"apply_ib_order_tag_overlay -> apply_order_field_update with a tag key that normalize_order_tag_update accepted but which is not a key in the serialized IBOrder JSON — typically a field present in IB's API but not modeled on this crate's IBOrder struct.","commonSituations":"Trying to set newer IB API fields (e.g. fields added in later TWS API versions) that the adapter's IBOrder struct doesn't serialize; using deprecated/renamed field names.","solutions":["Use only fields the crate's IBOrder struct actually serializes (inspect a serialized IBOrder or its serde definitions)","Request/patch support for the missing field on IBOrder, then rebuild","Remove the unsupported tag and configure the equivalent behavior through the adapter's own config or policy functions"],"exampleFix":"// before\n{\"min_trade_qty\": 1}\n// after\n// remove the tag or implement the field on IBOrder first","handlingStrategy":"validation","validationCode":"let serialized = serde_json::to_value(&ib_order)?;\nfor field in tags.keys() {\n    if !serialized.as_object().map_or(false, |o| o.contains_key(field)) {\n        return Err(anyhow::anyhow!(\"tag field not on IBOrder: {field}\"));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use tag fields that exist on the compiled version of IBOrder","After adapter upgrades, re-validate any persisted tag configurations","Serialize a sample IBOrder and keep it as a reference schema"],"tags":["interactive-brokers","json","validation","rust"],"backgroundTag":"unsupported-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}