Skip to content

[Feature] Adding THconfig schema as a new TH config field - #356

Open
antonio-amjr wants to merge 1 commit into
project-chip:v2.16-developfrom
antonio-amjr:feature/configurable_prompt_timeouts
Open

[Feature] Adding THconfig schema as a new TH config field#356
antonio-amjr wants to merge 1 commit into
project-chip:v2.16-developfrom
antonio-amjr:feature/configurable_prompt_timeouts

Conversation

@antonio-amjr

@antonio-amjr antonio-amjr commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fix: project-chip/certification-tool#1038
Related to:

  1. [Feature] Removing hardcoded prompt timeout matter-test-scripts#801
  2. [Feature] Adding a CLI timeout flag and unit tests certification-tool-cli#109

Description

User prompts during test execution timed out after a hardcoded 60s with no way to configure it. Adds a th_config object to the project's JSON config (alongside network/dut_config/test_parameters) holding Test-Harness-level
settings, starting with prompt_timeout_seconds. Also folds the existing ENABLE_REALTIME_PYTHON_TEST_LOGS env var into th_config as a per-project override, with the env var kept as the instance-wide fallback (non-breaking).

Changed

  • schemas/test_environment_config.py: new THConfig (prompt_timeout_seconds: int = 60, enable_realtime_python_test_logs: Optional[bool] = None), added as TestEnvironmentConfig.th_config. No DB migration — config is a schemaless JSON column.
  • user_prompt_support/prompt_request.py: PromptRequest.timeout is now Optional[int] = None (unresolved sentinel).
  • user_prompt_support/user_prompt_support.py: send_prompt_request() resolves an unresolved timeout from self.config["th_config"]["prompt_timeout_seconds"], falling back to 60s. Explicit per-call timeouts (120s/300s/600s tiers elsewhere) are
    untouched.
  • user_prompt_support/user_prompt_manager.py: defensive fallback in PromptExchange in case a future call site bypasses the funnel above.
  • Cleaned up 5 remaining redundant hardcoded timeout=60 sites (chip_suite.py, chip_test.py) and one dead constant.
  • python_testing/models/test_case.py: new _realtime_logs_enabled() — th_config.enable_realtime_python_test_logs overrides settings.ENABLE_REALTIME_PYTHON_TEST_LOGS when explicitly set.
  • default_project.config: added example th_config block.

Test plan

  • New unit tests: timeout resolution (valid/missing/malformed config, explicit-override-wins), THConfig schema validation, real-time-log toggle matrix (config × env var).
  • Existing prompt-support and Matter config tests still pass — verified no test asserts a literal timeout == 60.
  • Not yet run in CI by me (no local backend env) — please run pytest app/tests/user_prompts/ test_collections/matter/sdk_tests/support/tests/ before merging.

@antonio-amjr antonio-amjr self-assigned this Aug 21, 2026
@antonio-amjr antonio-amjr added the enhancement New feature or request label Aug 21, 2026
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a80bd60-4cd7-40bc-bfab-715aa1153f09

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant