forked from earendil-works/pi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-openai-codex.sh
More file actions
executable file
·67 lines (59 loc) · 2.1 KB
/
Copy pathtest-openai-codex.sh
File metadata and controls
executable file
·67 lines (59 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -e
echo "==================================="
echo "Testing OpenAI Codex Integration"
echo "==================================="
echo ""
# Check if auth.json exists
if [ -f ~/.pi/agent/auth.json ]; then
echo "✓ auth.json found at ~/.pi/agent/auth.json"
if grep -q "openai-codex" ~/.pi/agent/auth.json 2>/dev/null; then
echo "✓ openai-codex credentials found"
else
echo "✗ No openai-codex credentials found in auth.json"
echo " Run 'pi' and use /login to authenticate"
fi
else
echo "✗ No auth.json found"
echo " Run 'pi' and use /login to authenticate"
fi
echo ""
echo "Available openai-codex models:"
echo "------------------------------"
cd code/pi-infinity
node packages/coding-agent/dist/cli.js --list-models | grep "openai-codex" || echo "No models found matching 'openai-codex'"
echo ""
echo "Testing model resolution:"
echo "-------------------------"
# Test default model
DEFAULT_MODEL=$(node packages/coding-agent/dist/cli.js --provider openai-codex --print "test" 2>&1 | grep -i "model" | head -1 || echo "Could not determine model")
echo "Default model for openai-codex: $DEFAULT_MODEL"
echo ""
echo "OAuth Provider Info:"
echo "--------------------"
node -e "
const { getOAuthProviders } = require('./packages/ai/dist/utils/oauth/index.js');
const providers = getOAuthProviders();
const codex = providers.find(p => p.id === 'openai-codex');
if (codex) {
console.log('✓ openai-codex OAuth provider registered');
console.log(' Name:', codex.name);
console.log(' Uses callback server:', codex.usesCallbackServer);
} else {
console.log('✗ openai-codex OAuth provider not found');
}
"
echo ""
echo "==================================="
echo "Test complete!"
echo ""
echo "To login with OpenAI Codex:"
echo "1. Run: pi"
echo "2. Type: /login"
echo "3. Select 'ChatGPT Plus/Pro (Codex Subscription)'"
echo "4. Follow the browser prompts"
echo ""
echo "To use openai-codex models:"
echo " pi --provider openai-codex 'your prompt'"
echo " pi --provider openai-codex --model gpt-5.2-codex 'your prompt'"
echo "==================================="