Fix missing imports in sync-openai-agents template#278
Open
muhammad-rifky-scale wants to merge 1 commit into
Open
Fix missing imports in sync-openai-agents template#278muhammad-rifky-scale wants to merge 1 commit into
muhammad-rifky-scale wants to merge 1 commit into
Conversation
Add StreamTaskMessageFull and TextContent imports to acp.py.j2 so the no-API-key error response compiles correctly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jun 17, 2026
max-parke-scale
added a commit
that referenced
this pull request
Jun 17, 2026
Generalizes the #405 regression guard. Captures the requests the ADK emits (states.create/update for v1) and validates each against a window of supported server OpenAPI contracts vendored under tests/compat/server_specs/: `current` (scale-agentex main) and `min-supported` (pre-#278, which still requires task_id/agent_id in the state body). Catches the 0.13.0 class of break — a client that drops a field an older deployed server still requires. Verified: with the field-drop, states.update fails "task_id/agent_id required" against min-supported while passing current. Specs are vendored for deterministic CI (no network); refresh_specs.py re-pulls them at the SHAs in manifest.json. Advance min-supported as the oldest deployed server moves forward; extend _OPERATIONS for more ADK operations. Stacked on #405 (needs the extra_body fix so states.update passes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StreamTaskMessageFullto theTaskMessageUpdateimport inacp.py.j2TextContentimport fromagentex.types.text_contentContext
The issue was discovered when running
agentex initand selecting the Sync ACP + OpenAI Agents SDK template. The generatedacp.pywas missing two imports, causing runtime errors immediately after project initialization when OPENAI_API_KEY is not present.Test plan
agentex init, selected Sync ACP → Sync ACP + OpenAI Agents SDK, and verified the generated project contains the correct imports without errorsGreptile Summary
Fixes two missing imports in the
sync-openai-agentsJinja2 template that caused immediateNameErrorat runtime when usingagentex initwith the Sync ACP + OpenAI Agents SDK option.StreamTaskMessageFullto the import fromagentex.types.task_message_update(used on line 79 for the missing-API-key guard)TextContentimport fromagentex.types.text_content(used on line 82 to construct the error message content)Confidence Score: 5/5
Important Files Changed
StreamTaskMessageFull,TextContent) that are used on lines 79 and 82 respectively. Both symbols are verified exports from their source modules. No issues found.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["agentex init (Sync ACP + OpenAI Agents)"] --> B["Generates acp.py from acp.py.j2"] B --> C{"OPENAI_API_KEY set?"} C -- No --> D["yield StreamTaskMessageFull\nwith TextContent error message"] C -- Yes --> E["Run OpenAI Agent via Runner.run_streamed"] E --> F["convert_openai_to_agentex_events"] F --> G["yield agentex streaming events"] G --> H["Update task state via adk.state.update"] style D fill:#f9d71c,stroke:#333Last reviewed commit: 0d2c5f0