Skip to content

Use environment defaults for client async config#632

Open
liuzemei wants to merge 2 commits into
Agent-Field:mainfrom
liuzemei:fix-python-sdk-env-defaults-621
Open

Use environment defaults for client async config#632
liuzemei wants to merge 2 commits into
Agent-Field:mainfrom
liuzemei:fix-python-sdk-env-defaults-621

Conversation

@liuzemei

@liuzemei liuzemei commented Jun 8, 2026

Copy link
Copy Markdown

Fixes #621

Summary

  • initialize AgentFieldClient with AsyncConfig.from_environment() when no explicit async config is provided
  • preserve explicit async_config instances unchanged
  • add regression coverage for client-level environment defaults

Tests

  • uv run --extra dev pytest tests/test_async_config.py -q
  • uv run --extra dev pytest tests/test_client_unit.py tests/test_client_auth.py tests/test_async_config.py -q

Signed-off-by: Sheldon <neooosky@gmail.com>
@liuzemei liuzemei requested review from a team and AbirAbbas as code owners June 8, 2026 03:39
@CLAassistant

CLAassistant commented Jun 8, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ santoshkumarradha
❌ SheldonNeo
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.4 KB +4% 0.23 µs -34%

✓ No regressions detected

@santoshkumarradha santoshkumarradha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix. This brings AgentFieldClient in line with Agent by picking up async defaults from the environment, and the regression tests cover both the env-backed default path and the explicit override path.

I also approved the first-time contributor workflow runs so CI is now moving.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 84%, aggregate ≥ 85%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 87.10% 87.40% ↓ -0.30 pp 🟡
sdk-go 92.10% 92.00% ↑ +0.10 pp 🟢
sdk-python 93.73% 93.73% ↑ +0.00 pp 🟢
sdk-typescript 90.50% 90.42% ↑ +0.08 pp 🟢
web-ui 84.82% 84.79% ↑ +0.03 pp 🟡
aggregate 85.66% 85.75% ↓ -0.09 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 ➖ no changes
sdk-go 0 ➖ no changes
sdk-python 1 100.00%
sdk-typescript 0 ➖ no changes
web-ui 0 ➖ no changes

✅ Patch gate passed

Every surface whose lines were touched by this PR has patch coverage at or above the threshold.

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.

[Python SDK] Inconsistent defaults for AsyncConfig and AIConfig

4 participants