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 3 commits into
appwrite:mainfrom
pcbeingused333:c0833-retired-gpt35
Open

pcbeingused333 wants to merge 3 commits into
appwrite:mainfrom
pcbeingused333:c0833-retired-gpt35

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Nov 4, 2026 •

Copy link
Copy Markdown

The Python, Node, and PHP Prompt ChatGPT templates used the retired gpt-3.5-turbo model. This PR replaces it with gpt-5.6-terra, the replacement OpenAI lists in https://developers.openai.com/api/docs/deprecations, and passes the token budget as max_completion_tokens.

PHP now defaults to 512 completion tokens, matching Python and Node. It reads the documented OPENAI_MAX_TOKENS variable and falls back to MAX_TOKENS for existing deployments. PHP converts the configured value to an integer before sending it to the API, matching Python and Node. The three READMEs explain that GPT-5.x counts reasoning tokens toward the same limit.

Dart remains a separate follow-up because it needs a Dart SDK and dependency upgrade to send max_completion_tokens.

The Python and Node model migration was checked against a local Chat Completions stub. The PHP budget change was checked by inspecting the diff and verifying the environment lookup and fallback with git grep. No live OpenAI request was sent.

Disclosure: Prepared with AI coding assistance and 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

Comment thread php/prompt-chatgpt/src/index.php Outdated
'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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I raised PHP’s default to 512 to match Python and Node, and PHP now honors the documented OPENAI_MAX_TOKENS setting while retaining MAX_TOKENS as a fallback. The configured value is parsed as an integer. All three READMEs now explain that GPT-5.x reasoning tokens count toward that budget.

This comment was drafted with an AI coding assistant.

@pcbeingused333

Copy link
Copy Markdown
Author

Hi, just a gentle ping on this one in case it slipped through. Happy to adjust anything if needed. Thanks!

@pcbeingused333

Copy link
Copy Markdown
Author

Friendly ping: could someone take a look at this when there's time? Happy to adjust or rebase anything. Thanks!

@appwrite

appwrite Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Code review

Commit Status Tier Verdict Details
6528351 Reviewed Reviewed 🟢 S · Ready to merge 💬 Commented View review

The changed handlers and their documented token settings are consistent, with no identified defects.

Updates the Node, PHP, and Python prompt-chatgpt handlers to use GPT-5.6-terra and pass the configured response limit as max_completion_tokens. Their READMEs now describe the model and note that GPT-5.x token limits include reasoning tokens.

Note

@pcbeingused333 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

Walkthrough (6)
File Change
node/prompt-chatgpt/src/main.js Switches the chat completion request to GPT-5.6-terra and max_completion_tokens.
node/prompt-chatgpt/README.md Updates the model description and token-limit documentation.
php/prompt-chatgpt/src/index.php Switches the request model and completion limit parameter, retaining both environment variable names.
php/prompt-chatgpt/README.md Updates the model description and token-limit documentation.
python/prompt_chatgpt/src/main.py Switches the chat completion request to GPT-5.6-terra and max_completion_tokens.
python/prompt_chatgpt/README.md Updates the model description and token-limit documentation.

Reviewed 6528351

Tip

Comment @appwrite review to re-run, or mention @appwrite with a question.

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

🟢 Tier S · Looks good to merge. Summary

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