fix(a2a): validate session_id at entry of _handle_session_close before devcontainer cleanup #11098

Merged
HAL9000 merged 7 commits from feature/9250-fix-a2a-session-close into master 2026-06-17 16:38:46 +00:00

7 Commits

Author SHA1 Message Date
HAL9000 5b2e1c6a23 fix(a2a): remove unreachable session_id guard in _cleanup_session_devcontainers
CI / load-versions (pull_request) Successful in 16s
CI / push-validation (pull_request) Successful in 27s
CI / lint (pull_request) Successful in 44s
CI / typecheck (pull_request) Successful in 1m7s
CI / security (pull_request) Successful in 1m5s
CI / quality (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 35s
CI / helm (pull_request) Successful in 48s
CI / unit_tests (pull_request) Successful in 5m17s
CI / docker (pull_request) Successful in 1m45s
CI / integration_tests (pull_request) Successful in 8m57s
CI / coverage (pull_request) Successful in 10m11s
CI / status-check (pull_request) Successful in 6s
The empty-session_id guard at the top of _cleanup_session_devcontainers
became unreachable when _handle_session_close was hardened to raise
ValueError on missing/empty session_id before any cleanup runs. The
two dead lines were the only path through this method that the prior
"empty session_id and no service returns ok" coverage scenario
exercised; once that scenario was rewritten to assert the new
"error" verdict, the guard stopped being hit and the coverage gate
regressed below threshold.

Removing the dead branch restores coverage. The remaining body of
_cleanup_session_devcontainers is always called with a non-empty
session_id (both call sites in _handle_session_close run after the
entry-level ValueError guard), and the docstring now records that
invariant for future readers.

ISSUES CLOSED: #9250
2026-06-17 11:36:27 -04:00
HAL9000 92ad8c40bf test(a2a): align Robot M6 session.close helper with session_id guard
CI / load-versions (pull_request) Successful in 15s
CI / push-validation (pull_request) Successful in 27s
CI / lint (pull_request) Successful in 38s
CI / typecheck (pull_request) Successful in 59s
CI / security (pull_request) Successful in 1m11s
CI / quality (pull_request) Successful in 59s
CI / build (pull_request) Successful in 59s
CI / helm (pull_request) Successful in 56s
CI / unit_tests (pull_request) Successful in 6m54s
CI / docker (pull_request) Successful in 2m0s
CI / integration_tests (pull_request) Successful in 11m20s
CI / coverage (pull_request) Failing after 15m38s
CI / status-check (pull_request) Has been cancelled
The session_id validation guard added to _handle_session_close in
A2aLocalFacade raises ValueError when session_id is empty. The prior
commit aligned the Behave .feature scenarios but missed the Robot
helper at robot/helper_m6_autonomy_acceptance.py, which still
dispatched session.close with empty params and tripped the new
guard — causing the M6 A2A Facade Session Lifecycle integration
test to fail.

Pass the session_id returned by the preceding session.create call
so the close round-trip succeeds end-to-end.

ISSUES CLOSED: #9250
2026-06-17 08:49:34 -04:00
HAL9000 191482d0ef test(a2a): align session.close smoke scenarios with session_id guard
The session_id validation guard added to _handle_session_close in
A2aLocalFacade now raises ValueError when session_id is empty or
missing. Update three pre-existing smoke scenarios that previously
dispatched session.close with empty params to pass an explicit
session_id, aligning the smoke contract with the security fix.

The negative-path scenarios (@tdd_issue_9250) in
a2a_facade_coverage.feature continue to verify the ValueError path
with empty/missing session_id.

ISSUES CLOSED: #9250
2026-06-17 08:49:34 -04:00
controller-ci-rerun 4c9acaa396 chore: re-trigger CI [controller] 2026-06-17 08:49:34 -04:00
HAL9000 787b99329a fix(a2a): correct IndentationError, add tdd_issue_9250 tags, fix CONTRIBUTORS
- Fix 2-space -> 4-space indentation on _handle_session_close in
  facade.py; this single error caused every CI gate to fail
  (lint, typecheck, unit_tests, integration_tests, e2e_tests, security)
- Add @tdd_issue @tdd_issue_9250 tags to the three session_id
  validation scenarios in a2a_facade_coverage.feature per the mandatory
  bug-fix TDD workflow requirement
- Fix CONTRIBUTORS.md entry: was PR #11053 / issue #9094, corrected to
  PR #11098 / issue #9250

ISSUES CLOSED: #9250
2026-06-17 08:49:34 -04:00
HAL9000 901e3e360b fix(a2a): close session_id validation bypass in _handle_session_close
Removed unreachable duplicate code left over after moving session_id validation
to the top of _handle_session_close(). Updated BDD test scenario in
a2a_facade_wiring.feature to cover the no-service + empty session_id path.

PR-CLOSED: #9250
2026-06-17 08:49:34 -04:00
HAL9000 863be6780a fix(a2a): validate session_id at entry of _handle_session_close before devcontainer cleanup
The _handle_session_close handler in the A2A local facade previously validated
session_id only after checking whether a session service was wired. When no
session service was available, _cleanup_session_devcontainers() was invoked
with an empty or missing session_id, risking incorrect container lifecycle
operations on unknown sessions. This fix moves validation to the top of
_handle_session_close so it applies uniformly across both code paths.

Updated BDD tests in features/a2a_facade_wiring.feature and
features/a2a_facade_coverage.feature to reflect the new validation behavior.

PR-CLOSED: #9250
2026-06-17 08:49:34 -04:00