Skip to content

Fix agentic OpenAI transport#900

Merged
luv-bansal merged 6 commits intomasterfrom
fix-agentic-openai-transport
Jan 13, 2026
Merged

Fix agentic OpenAI transport#900
luv-bansal merged 6 commits intomasterfrom
fix-agentic-openai-transport

Conversation

@luv-bansal
Copy link
Copy Markdown
Contributor

@luv-bansal luv-bansal commented Jan 13, 2026

This PR fixes the agentic OpenAI transport by correcting how tool calls are accessed from OpenAI response objects, and adds a "none" mode option to the local-runner CLI command.

Changes:

  • Fixed attribute access for OpenAI response objects in agentic transport to use hasattr() checks instead of dictionary .get() methods
  • Added "none" mode to the --mode CLI option for local-runner command and changed the default from "env" to "none"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the agentic OpenAI transport by correcting how tool calls are accessed from OpenAI response objects, and adds a "none" mode option to the local-runner CLI command.

Changes:

  • Fixed attribute access for OpenAI response objects in agentic transport to use hasattr() checks instead of dictionary .get() methods
  • Added "none" mode to the --mode CLI option for local-runner command and changed the default from "env" to "none"

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
clarifai/runners/models/agentic_class.py Fixed OpenAI transport to properly access response object attributes using hasattr() checks for safe nested attribute access to tool_calls
clarifai/cli/model.py Added "none" mode option and changed default mode from "env" to "none" for the local-runner command

Comment thread clarifai/cli/model.py Outdated
Copy link
Copy Markdown
Contributor

@srikanthbachala20 srikanthbachala20 left a comment

Choose a reason for hiding this comment

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

LGTM

@luv-bansal luv-bansal enabled auto-merge (squash) January 13, 2026 10:15
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
clarifai 45%
clarifai.cli 63%
clarifai.cli.templates 46%
clarifai.client 68%
clarifai.client.auth 67%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.modules 0%
clarifai.rag 0%
clarifai.runners 52%
clarifai.runners.models 65%
clarifai.runners.pipeline_steps 41%
clarifai.runners.pipelines 77%
clarifai.runners.utils 62%
clarifai.runners.utils.data_types 72%
clarifai.schema 100%
clarifai.urls 60%
clarifai.utils 60%
clarifai.utils.evaluation 67%
clarifai.workflows 95%
Summary 64% (10004 / 15714)

Minimum allowed line rate is 50%

@luv-bansal luv-bansal merged commit 9954cd5 into master Jan 13, 2026
11 checks passed
@luv-bansal luv-bansal deleted the fix-agentic-openai-transport branch January 13, 2026 10:50
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.

3 participants