refactor(agent): remove Vercel adapter dead aliases#4766
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer guide: interesting codeThis PR only deletes dead shims. I grepped the whole repo for each removed name to confirm no live caller. Results below.
Net: all removed names are dead at their old locations, and the canonical functions are unchanged. Safe to approve quickly. |
| register_agent_message_routes, | ||
| resolve_session_id, | ||
| ) | ||
| from agenta.sdk.agents.adapters.vercel.routing import register_agent_message_routes |
There was a problem hiding this comment.
Trimmed to import only register_agent_message_routes. The dropped resolve_session_id/inject_stream_session_id were only fed into the now-deleted underscore wrappers below, so nothing else needed them.
|
|
||
| from .adapters.vercel import ( | ||
| agent_run_to_vercel_parts, | ||
| from_ui_messages, |
There was a problem hiding this comment.
This module is now a thin facade over the three names callers actually use through it. The dropped re-exports (vercel_ui_messages_to_messages, message_to_vercel_ui_message, agent_run_to_vercel_parts) had no importers via ui_messages; callers reach them straight from agents.adapters.vercel.
|
Superseded. Replacing the path-based stack with PRs sliced by functional area showing final code only, so reviewers don't comment on intermediate scaffolding that a later PR rewrites. See the new set. |
This PR is part of a stack. Review bottom-up.
Each PR's diff is only its own delta. Merge from the bottom. This PR's base is #4765 (merge that first).
Context
The Vercel adapter moved into its own package (
agents/adapters/vercel/). That move left behind a set of compatibility shims: underscore-prefixed aliases and re-exports that pointed back at the new canonical names. Nothing reads them anymore. This PR base isfeat/sdk-local-tools-runner-docs. It is slice #2 (protocol shell hardening) ofdocs/design/agent-workflows/pr-stack.md, the dead-code removal step.What this changes
This deletes the leftover aliases. The canonical functions stay exactly where they are. No call site changes, no behavior changes. The diff is one trimmed import plus the removed shim lines.
Key architectural decision to review
The only thing to confirm is that the removed names have no live callers. Here is what was removed and where it lived:
_resolve_session_idand_inject_stream_session_id: compatibility wrappers insdks/python/agenta/sdk/decorators/routing.py. The real helpers areresolve_session_idandinject_stream_session_idin the Vercel adapter._VERCEL_UI_MESSAGE_STREAM_HEADERSand_vercel_sse_stream: self-aliases at the bottom ofsdks/python/agenta/sdk/agents/adapters/vercel/sse.py. The canonical namesVERCEL_UI_MESSAGE_STREAM_HEADERSandvercel_sse_streamare untouched.vercel_ui_messages_to_messages,message_to_vercel_ui_message, andagent_run_to_vercel_parts: re-exports trimmed fromsdks/python/agenta/sdk/agents/ui_messages.py. These names still live in the adapter package and are imported directly from there.One subtlety worth a second look:
decorators/routing.pyimports the canonicalsse.pynames and locally re-aliases them withas _VERCEL_UI_MESSAGE_STREAM_HEADERSandas _vercel_sse_stream. That local alias is separate from the deleted self-aliases insidesse.py, so it keeps working.How to review this PR
Grep the codebase for each removed name and confirm zero live callers, then approve. The removed underscore wrappers have no callers. The trimmed
ui_messages.pyre-exports have no importers that go throughui_messages; every caller imports the canonical names directly fromagents.adapters.vercel. This is safe to approve quickly.