Skip to content

fix(codegen): preserve regenerated response aliases#824

Closed
sangilish wants to merge 4 commits into
adcontextprotocol:mainfrom
sangilish:fix/codegen-protocol-envelope-aliases-822
Closed

fix(codegen): preserve regenerated response aliases#824
sangilish wants to merge 4 commits into
adcontextprotocol:mainfrom
sangilish:fix/codegen-protocol-envelope-aliases-822

Conversation

@sangilish
Copy link
Copy Markdown
Contributor

@sangilish sangilish commented May 22, 2026

Summary

Refs #822.

This rebuilds the codegen response-alias fix on current main after the earlier branch conflicted with the AdCP 3.1 generated/type-codegen changes.

The change keeps the clean-regeneration path working for restored response aliases:

  • re-sync ProtocolEnvelope imports after post_generate_fixes.py restores manual response arms
  • include annotated TypeAlias assignments when consolidating generated exports
  • avoid eager _g.FooResponse fallback lookups in aliases.py
  • commit the regenerated type outputs from the fixed pipeline
  • add regression coverage for those three failure modes

Testing

  • uv run --extra dev python scripts/generate_types.py
  • uv run --extra dev python -c "from adcp.types import _generated; from adcp.types import aliases; print('import-ok')"
  • uv run --extra dev pytest tests/test_code_generation.py tests/test_asset_aliases_stable.py tests/test_schemas_version_pin.py -q --tb=short
  • uv run --extra dev ruff check --ignore E501 scripts/consolidate_exports.py scripts/post_generate_fixes.py src/adcp/types/aliases.py tests/test_code_generation.py
  • git diff --check

Full-suite note: uv run --extra dev pytest -q --tb=short completed with one unrelated wall-clock boundary failure in tests/test_pg_idempotency_backend.py::test_delete_expired_defaults_to_wall_clock (5277 passed, 38 skipped, 9 deselected, 1 xfailed, 1 failed). Re-running that single test passed: uv run --extra dev pytest tests/test_pg_idempotency_backend.py::test_delete_expired_defaults_to_wall_clock -q --tb=short.

@bokelley
Copy link
Copy Markdown
Contributor

Tried to update this branch against current main, but GitHub reports conflicts. I confirmed the conflicts are in generated/type-codegen areas touched since this branch was cut: scripts/post_generate_fixes.py, scripts/consolidate_exports.py, src/adcp/types/_generated.py, src/adcp/types/aliases.py, and media-buy generated POC response modules that now include the AdCP 3.1 task-envelope/media_buy_status changes. Moving this out of the review-ready bucket until it is rebased/regenerated on current main.

@sangilish sangilish force-pushed the fix/codegen-protocol-envelope-aliases-822 branch from 5dbb746 to 97dfba3 Compare May 24, 2026 21:37
bokelley
bokelley previously approved these changes May 25, 2026
Copy link
Copy Markdown
Contributor

@bokelley bokelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed local follow-up changes; checks are green.

@bokelley bokelley enabled auto-merge (squash) May 25, 2026 01:46
Copy link
Copy Markdown
Contributor

@bokelley bokelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed latest follow-up changes; CI is green.

@bokelley
Copy link
Copy Markdown
Contributor

Closed as superseded by #854, which carried the same patch stack on an in-repository branch so CodeQL and Argus could run under normal branch protection.

@bokelley bokelley closed this May 25, 2026
auto-merge was automatically disabled May 25, 2026 02:09

Pull request was closed

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