Skip to content

Make 0.2.0 run on Pixeltable 0.7.17 - #27

Merged
pierrebrunelle merged 1 commit into
mainfrom
pixelagent-0.2.0-pxt-0717
Oct 15, 2026
Merged

pierrebrunelle merged 1 commit into
mainfrom
pixelagent-0.2.0-pxt-0717

Conversation

@pierrebrunelle

Copy link
Copy Markdown
Member

Summary

  • Pin pixelagent 0.2.0 to Pixeltable >= 0.7.15, < 0.8, locked at 0.7.17. A changed model updates the computed column; SchemaConflict stays for edits update_all() refuses.
  • Honor max_tokens on OpenAI, Anthropic, Gemini, and Bedrock. Replace retired Anthropic and Gemini model ids, send Bedrock images in Converse blocks, and pass Gemini images as inline parts.
  • Stop OpenAI tool follow-up calls from re-sending tools, fix examples that crashed on a second Agent(), and add provider extras.

Test plan

  • uv run pytest tests/ -m "not live" on locked Pixeltable 0.7.17 (93 passed)
  • Canary: PyPI pixeltable 0.7.17, pip install -e . --no-deps, tests/test_smoke.py (53 passed)
  • pytest tests/test_openai.py -m live (basic chat and tool calling)
  • CI on this PR, including the unpinned canary and Python 3.13
  • release.yml dry run, then tag v0.2.0 after the checks are green

Made with Cursor

A changed model updates the chat pipeline, max_tokens reaches every provider, and the OpenAI tool follow-up no longer re-sends tools.

Co-authored-by: Cursor <cursoragent@cursor.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

Comment thread pixelagent/core/limits.py
Comment on lines +23 to +24
if "max_tokens" not in merged and "max_completion_tokens" not in merged:
merged["max_tokens"] = max_tokens

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Reasoning-model chats reject the token cap

For an OpenAI reasoning model such as o3, openai_model_kwargs injects unsupported max_tokens by default. The provider rejects the request, so chats that previously worked fail.

Learn more

The OpenAI agent accepts a caller-selected model, while openai_model_kwargs inserts max_tokens for every model lacking a token option. Reasoning models such as o3 require max_completion_tokens instead. This makes a default-configured chat fail even though its model and prompt are valid. The selected model is available when the provider call builds the arguments, but is not passed into the helper.

Example: Construct an OpenAI agent with model="o3" and call chat("Hello") without chat_kwargs. The helper supplies max_tokens=4096; the API rejects that parameter rather than returning a reply.

Recommended fix: Pass the model to openai_model_kwargs and select the supported cap key for that model, preserving an explicitly supplied max_completion_tokens or max_tokens. Add a test for a reasoning-model request without caller-supplied options.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +28 to +29
buf = io.BytesIO()
image.save(buf, format="JPEG")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Transparent Gemini images abort chats

When chat() receives an RGBA image, create_content saves it as JPEG without converting its mode. Pillow rejects the image before Gemini receives the request.

Learn more

The chat API accepts PIL images, including RGBA images commonly loaded from PNG files. Gemini's new image path saves every image directly as JPEG. Pillow cannot encode an RGBA image as JPEG, so the turn fails during prompt construction and never reaches the provider.

Example: Pass Image.new("RGBA", (8, 8), (255, 0, 0, 128)) to a Gemini agent's chat("Describe this", image=image). The save raises an error rather than returning a description.

Recommended fix: Convert unsupported modes before JPEG encoding, deciding how to composite transparency, or use PNG and its matching MIME type for images with transparency. Extend the image test to cover an RGBA image.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@pierrebrunelle
pierrebrunelle merged commit 2afeaf8 into main Oct 15, 2026
8 checks passed
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.

1 participant