Skip to content

fix: prevent exception details in agent server responses - #800

Merged
AbirAbbas merged 3 commits into
mainfrom
agent/fix-codeql-exception-exposure
Jul 21, 2026
Merged

fix: prevent exception details in agent server responses#800
AbirAbbas merged 3 commits into
mainfrom
agent/fix-codeql-exception-exposure

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What changed

  • Removed raw exception text from the /shutdown and /status error responses.
  • Added regression tests that force both handlers to fail and verify that internal exception details are not returned.

Why

CodeQL reported py/stack-trace-exposure because exception text was included in externally visible response messages. The underlying exception remains available in development-mode logs for diagnosis, while clients receive stable generic error messages.

Validation

  • uv run --project sdk/python --extra dev pytest sdk/python/tests/test_agent_server.py sdk/python/tests/test_agent_server_extended.py
  • Result: 53 passed

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.5 KB +5% 0.24 µs -31%

✓ No regressions detected

@github-actions

github-actions Bot commented Jul 20, 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 86.90% 87.40% ↓ -0.50 pp 🟡
sdk-go 92.40% 92.00% ↑ +0.40 pp 🟢
sdk-python 93.82% 93.73% ↑ +0.09 pp 🟢
sdk-typescript 91.08% 90.42% ↑ +0.66 pp 🟢
web-ui 84.75% 84.79% ↓ -0.04 pp 🟡
aggregate 85.54% 85.75% ↓ -0.21 pp 🟡

✅ Gate passed

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

@github-actions

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 0 ➖ no changes
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.

@santoshkumarradha
santoshkumarradha marked this pull request as ready for review July 20, 2026 21:03
@santoshkumarradha
santoshkumarradha requested review from a team and AbirAbbas as code owners July 20, 2026 21:03
@AbirAbbas
AbirAbbas enabled auto-merge July 21, 2026 14:08
@AbirAbbas
AbirAbbas added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 26c8428 Jul 21, 2026
28 checks passed
@AbirAbbas
AbirAbbas deleted the agent/fix-codeql-exception-exposure branch July 21, 2026 14:17
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.

2 participants