Skip to content

feat(ws24): add format_response.py utility + unit tests [WS2.4-02, WS2.4-03]#5

Merged
Piboonsak merged 1 commit intomainfrom
feat/ws24-format-response
Mar 1, 2026
Merged

feat(ws24): add format_response.py utility + unit tests [WS2.4-02, WS2.4-03]#5
Piboonsak merged 1 commit intomainfrom
feat/ws24-format-response

Conversation

@Piboonsak
Copy link
Owner

Changes

  • docker/scripts/format_response.py: Extract text + sessionId tail from gateway JSON
  • tests/test_format_response.py: 14 unit tests (happy path, Thai text, truncation, multi-payload, errors)
  • Output format: {text} [{sessionId-8}]

Functions

  • format_response(raw): Returns compact log line
  • format_response_full(raw): Returns structured dict (text, sessionId, payloadCount)

Testing

  • 14 unit tests covering: happy path, Thai/non-ASCII, short/missing sessionId, truncation, multi-payload, malformed JSON, missing fields

@Piboonsak Piboonsak merged commit 0c1b045 into main Mar 1, 2026
2 of 9 checks passed
@Piboonsak Piboonsak deleted the feat/ws24-format-response branch March 1, 2026 12:11
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.

1 participant