Исправить project_id Gemini из ADC#2500
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #2499
Working session summaryImplemented and pushed the fix to PR 2500: #2500 Changed index.php so Gemini can resolve Verified with the AI chat/provider tests, PHP syntax checks, the new regression test, and This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (142.1K + 3.3M cached) input tokens, 20.6K output tokens, $5.607788 cost 🤖 Models used:
📎 Log file uploaded as Gist (24166KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Fixes #2499
Problem
Gemini is the default AI provider and uses the Vertex AI OpenAI-compatible endpoint with
{project_id}. The server only looked for that project id in explicit provider settings or env variables, so a valid ADC setup withproject_idinGOOGLE_APPLICATION_CREDENTIALS_JSONor the credentials file still failed with{"error":"Не указан Google Cloud project_id для Gemini"}.Solution
projectId,project_id, orgoogleProjectIdfrom the merged provider config before falling back to saved profile settings.CLOUDSDK_CORE_PROJECT.project/project-id)..gitkeepplaceholder from the PR diff.origin/maininto this branch after PR Добавить подсказку к полю проверки уникальности #2498 landed.Reproduce
Before this change,
php experiments/test-issue-2499-gemini-project-id.phpfails with the reported Geminiproject_iderror even when ADC JSON containsproject_id.After this change, the Gemini endpoint is prepared with
/projects/<id>/...and no{project_id}placeholder remains.Tests
php experiments/test-issue-2499-gemini-project-id.phpnode experiments/test-issue-2483-ai-chat-server.jsnode experiments/test-issue-2481-ai-providers.jsnode experiments/test-issue-2491-ai-chat-current-db.jsnode experiments/test-issue-2495-unique-key-ui.jsnode experiments/test-issue-2486-ai-chat-local-storage.jsnode experiments/test-issue-2471-ai-chat.jsnode experiments/test-issue-2474-ai-chat-global.jsnode experiments/test-issue-2488-ai-chat-button-border.jsnode --check js/ai-chat.jsphp -l index.phpphp -l experiments/test-issue-2499-gemini-project-id.phpgit diff --check origin/main...HEAD