[Fix] Prefer operational_dataset_hex over live OTBR dataset in ThreadAutoConfig - #324
Merged
rquidute merged 1 commit intoMay 28, 2026
Conversation
Contributor
There was a problem hiding this comment.
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.
oxesoft
approved these changes
May 27, 2026
antonio-amjr
approved these changes
May 27, 2026
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
Contributor
|
Cherry-picked to v2.16-develop |
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.
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
backend/test_collections/matter/sdk_tests/support/python_testing/models/utils.py
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
Releated Issue
[#1004](project-chip/certification-tool#1004
Testing
Unit tests passing
Requesting originator to test in PRs branch - Waiting for feedbacks