Skip to content

[Fix] Prefer operational_dataset_hex over live OTBR dataset in ThreadAutoConfig - #324

Merged
rquidute merged 1 commit into
v2.15.1-developfrom
fix/1004-thread-autoconfig-prefer-operational-dataset-hex
May 28, 2026
Merged

[Fix] Prefer operational_dataset_hex over live OTBR dataset in ThreadAutoConfig#324
rquidute merged 1 commit into
v2.15.1-developfrom
fix/1004-thread-autoconfig-prefer-operational-dataset-hex

Conversation

@rquidute

Copy link
Copy Markdown
Contributor

Fixes NFC-Thread commissioning failures (TC-DD-3.23, TC-DD-3.24) where the Thread dataset passed to the SDK diverged from the dataset encoded in the NFC tag, causing ContinueCommissioningAfterConnectNetworkRequest to time out on FindOperationalForStayActive.

Changes

  • backend/app/schemas/test_environment_config.py

    • Added operational_dataset_hex: Optional[str] = None to ThreadAutoConfig
  • backend/test_collections/matter/sdk_tests/support/python_testing/models/utils.py

    • In __thread_dataset_hex(), when ThreadAutoConfig has operational_dataset_hex set, use it directly instead of querying the live OTBR via ot-ctl dataset active -x

Motivation

When a project config contains ThreadAutoConfig fields (rcp_serial_path, dataset, etc.) alongside operational_dataset_hex, Pydantic was silently dropping operational_dataset_hex because the field was not declared on the model. As a result, __thread_dataset_hex() always fell through to border_router.active_dataset, which queries the live OTBR and may return a different dataset than what the NFC tag was programmed with. The DUT would join a Thread network the TH controller didn't know about, and operational mDNS discovery would time out after 45 seconds.

This was confirmed by testing: creating a new CLI project via scripts populated the config with the full ThreadAutoConfig shape plus operational_dataset_hex. The hex was dropped by Pydantic, the live OTBR returned a mismatched dataset, and commissioning failed. Using a config with only operational_dataset_hex (matching the GUI project shape) passed in all scenarios.

Impact

  • No breaking changes. The fix is purely additive — operational_dataset_hex is optional with a None default, so existing ThreadAutoConfig configs without the field are unaffected.
  • When operational_dataset_hex is not set, behaviour is identical to before: the live OTBR dataset is fetched via active_dataset.
  • Fixes TC-DD-3.23 and TC-DD-3.24 for CLI projects configured with ThreadAutoConfig + operational_dataset_hex.

Releated Issue

[#1004](project-chip/certification-tool#1004

Testing

Unit tests passing

Requesting originator to test in PRs branch - Waiting for feedbacks

@rquidute rquidute self-assigned this May 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the operational_dataset_hex field to the ThreadAutoConfig schema and updates the Thread dataset retrieval logic to support this new optional configuration. However, a critical issue was identified: wrapping the OTBR startup and topology formation inside the else block prevents the OTBR container from starting when operational_dataset_hex is provided. The reviewer suggested a code modification to ensure the OTBR container is always started and configured, using the hex dataset as an override only for the returned value.

@rquidute
rquidute requested review from antonio-amjr and oxesoft May 27, 2026 15:39
@rquidute
rquidute merged commit 5ef3951 into v2.15.1-develop May 28, 2026
7 of 9 checks passed
@rquidute
rquidute deleted the fix/1004-thread-autoconfig-prefer-operational-dataset-hex branch May 28, 2026 12:17
oxesoft pushed a commit that referenced this pull request May 28, 2026
@oxesoft

oxesoft commented May 28, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked to v2.16-develop

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.

3 participants