Fix missing imports in sync-openai-agents template#278
Open
muhammad-rifky-scale wants to merge 1 commit intomainfrom
Open
Fix missing imports in sync-openai-agents template#278muhammad-rifky-scale wants to merge 1 commit intomainfrom
muhammad-rifky-scale wants to merge 1 commit intomainfrom
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 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