Skip to content

fix(prompt-chatgpt): replace gpt-3.5-turbo, shut down by OpenAI on 2026-10-23 - #489

Open
pcbeingused333 wants to merge 1 commit into
appwrite:mainfrom
pcbeingused333:c0833-retired-gpt35
Open

pcbeingused333 wants to merge 1 commit into
appwrite:mainfrom
pcbeingused333:c0833-retired-gpt35

Conversation

@pcbeingused333

Copy link
Copy Markdown

The prompt-chatgpt function templates call gpt-3.5-turbo, which OpenAI shut down on 2026-10-23, so a freshly deployed python, node or php template answers every request with "Failed to query model."

Fix:

  • use gpt-5.6-terra, the replacement OpenAI lists for gpt-3.5-turbo (https://developers.openai.com/api/docs/deprecations), in the three main files and their READMEs;
  • send the token limit as max_completion_tokens instead of max_tokens, since the gpt-5 family rejects max_tokens. The OPENAI_MAX_TOKENS / MAX_TOKENS env var names are unchanged;
  • drop the README sentence claiming a 4096-token limit for GPT-3.5-turbo.

Not changed: the dart template. dart_openai 3.x, the newest line compatible with its Dart 2 SDK constraint, still sends max_tokens, so fixing it needs a dependency/SDK bump that seems better as its own change. It keeps pointing at the retired model for now.

Testing: the repo has no tests for these templates, so the python (openai<0.28) and node (openai@^4.47) handlers were run against a local stub of /v1/chat/completions that answers 400 for a model outside gpt-5* or when max_tokens is in the body. On main both return 500; with this change both return 200. The php template was changed the same way but not executed. Not run against a live OpenAI key, so whether a small max_completion_tokens budget (default 512) is enough for a reasoning model's output is untested.


Disclosure: prepared with the assistance of an AI coding tool (Claude), submitted for human review.

…26-10-23

OpenAI retired gpt-3.5-turbo on 2026-10-23 and names gpt-5.6-terra as its
replacement, so the prompt-chatgpt templates fail on every request. Point the
python, node and php templates and their READMEs at gpt-5.6-terra, and send
the limit as max_completion_tokens: the gpt-5 family rejects max_tokens.

The dart template is left unchanged: dart_openai 3.x (the newest release that
supports its Dart 2 SDK constraint) still sends max_tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ghost

ghost commented Nov 4, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The model and request parameter changes are valid, but the PHP default completion budget can leave multi-step prompts with truncated or empty visible answers.

The Python, Node, and PHP prompt-chatgpt templates now use GPT-5.6-terra and send their configured limits as max_completion_tokens. Their READMEs describe the new model and remove the GPT-3.5-specific token-limit text.

Verdict New comments Fixed Still open
💬 Commented 1 0 0

Note

Not approving while a bug finding is open: 150-token cap also limits GPT-5.6 reasoning

Finding Where
🟡 150-token cap also limits GPT-5.6 reasoning php/prompt-chatgpt/src/index.php:26
Fix with agent prompt
### Issue 1
php/prompt-chatgpt/src/index.php:26
**150-token cap also limits GPT-5.6 reasoning**

`max_completion_tokens` counts internal reasoning tokens as well as visible answer text, so the PHP template's default budget of 150 can be consumed before a multi-step prompt gets a useful answer; the handler still returns this as a successful completion. The old GPT-3.5 `max_tokens` limit did not have this reasoning-token cost, so consider raising the default or documenting that the configured budget includes reasoning.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 6
File Change
node/prompt-chatgpt/README.md Updates the model description and removes the GPT-3.5 token-limit statement.
node/prompt-chatgpt/src/main.js Switches the Chat Completions request to GPT-5.6-terra and max_completion_tokens.
php/prompt-chatgpt/README.md Updates the model description and removes the GPT-3.5 token-limit statement.
php/prompt-chatgpt/src/index.php Switches the Chat Completions request to GPT-5.6-terra and max_completion_tokens.
python/prompt_chatgpt/README.md Updates the model description and removes the GPT-3.5 token-limit statement.
python/prompt_chatgpt/src/main.py Switches the Chat Completions request to GPT-5.6-terra and max_completion_tokens.

Reviewed 4e69811 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost 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.

🔵 Tier A · See the inline comments. Summary

'model' => 'gpt-3.5-turbo',
'max_tokens' => $_ENV['MAX_TOKENS'] ?: 150,
'model' => 'gpt-5.6-terra',
'max_completion_tokens' => $_ENV['MAX_TOKENS'] ?: 150,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

150-token cap also limits GPT-5.6 reasoning

max_completion_tokens counts internal reasoning tokens as well as visible answer text, so the PHP template's default budget of 150 can be consumed before a multi-step prompt gets a useful answer; the handler still returns this as a successful completion. The old GPT-3.5 max_tokens limit did not have this reasoning-token cost, so consider raising the default or documenting that the configured budget includes reasoning.

Prompt To Fix With AI
This is a comment left during a code review.
Path: php/prompt-chatgpt/src/index.php
Line: 26

Comment:
**150-token cap also limits GPT-5.6 reasoning**

`max_completion_tokens` counts internal reasoning tokens as well as visible answer text, so the PHP template's default budget of 150 can be consumed before a multi-step prompt gets a useful answer; the handler still returns this as a successful completion. The old GPT-3.5 `max_tokens` limit did not have this reasoning-token cost, so consider raising the default or documenting that the configured budget includes reasoning.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

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