Skip to content

fix(mapper): handle struct payloads in stringify_keys and simplify rate-limit fixture/test#3

Open
icostan wants to merge 1 commit intoagentjido:mainfrom
icostan:fix/mapper-struct-rate-limit
Open

fix(mapper): handle struct payloads in stringify_keys and simplify rate-limit fixture/test#3
icostan wants to merge 1 commit intoagentjido:mainfrom
icostan:fix/mapper-struct-rate-limit

Conversation

@icostan
Copy link
Copy Markdown

@icostan icostan commented Apr 3, 2026

Summary

  • Fix mapper crash when codex_sdk emits struct payloads (notably Codex.Protocol.RateLimit.Snapshot)
    under app-server transport.
  • Update stringify_keys/1 to handle structs safely before recursive key normalization.
  • Update fixtures/tests to align with latest codex_sdk rate-limit payload shape.

Changes

  • Add struct handling path in mapper:
    • convert structs via Map.from_struct/1
    • continue recursive key stringification
  • Update rate_limits_updated fixture to return a minimal RateLimit.Snapshot.
  • Update mapper tests to assert snapshot-based payload mapping through fixtures.
  • Keep dependency updates aligned with latest codex_sdk (mix.exs + mix.lock).

Why

mix codex.smoke ... --transport app_server could fail with:
Protocol.UndefinedError for Codex.Protocol.RateLimit.Snapshot in mapper key normalization.

Validation

  • mix test
  • mix quality
  • Smoke run verified in terminal:
    • mix codex.smoke "Say hello" --transport app_server
    • completed successfully with normalized events.

…-limit fixture/test with latest codex-sdk lib
@mikehostetler mikehostetler added the action Maintainer-side next action label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action Maintainer-side next action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants