Skip to content

Complete token error sanitization across agent containers - #40

Merged
Brandon Werner (brandwe) merged 1 commit into
mainfrom
fix/24-token-error-sanitization
Sep 1, 2026
Merged

Complete token error sanitization across agent containers#40
Brandon Werner (brandwe) merged 1 commit into
mainfrom
fix/24-token-error-sanitization

Conversation

@brandwe

Copy link
Copy Markdown
Member

Summary

  • adds sanitize_token_error to every deployable service-local token exchange module
  • sanitizes the two remaining direct A2A response paths
  • adds a contract test that keeps service copies byte-for-byte synchronized with src/shared
  • rejects client-facing detail fields that call get_last_token_error() directly
  • runs the token-exchange provider tests in CI
  • documents test-first TDD as a repository requirement

TDD sequence

  1. Added the regression contract test.
  2. Confirmed it failed on raw token errors in budget-report/app.py and budget-approval/app.py.
  3. Applied the minimal response sanitization fix.
  4. Confirmed the same test passed.

Local checks

  • python3 -m unittest src/test_token_error_contract.py -v
  • python3 -m compileall -q src
  • bash -n deploy.sh
  • git diff --check

Closes #24

Keep every deployable token-exchange copy synchronized with the shared module, prevent raw token acquisition errors from reaching A2A responses, and add CI contracts for both guarantees. Document test-first TDD as a repository requirement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 71cc0af5-8229-461b-ae4c-54131b1bd6c7
@brandwe
Brandon Werner (brandwe) merged commit 2cb13bf into main Sep 1, 2026
9 checks passed
@brandwe
Brandon Werner (brandwe) deleted the fix/24-token-error-sanitization branch September 1, 2026 16:27
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.

Fix service-local sanitize_token_error import regression

1 participant