Add LinaAI automatic Codex routing
This commit is contained in:
@@ -19,7 +19,7 @@ These rules apply to any self-hosted AI coding assistant working on Agrarian.
|
||||
|
||||
Stop local work and prepare a Codex handoff when any of these are true:
|
||||
|
||||
- confidence is below `0.65`,
|
||||
- confidence is below `0.75`,
|
||||
- tests fail twice,
|
||||
- build fails twice,
|
||||
- Unreal compile errors persist after one focused fix,
|
||||
|
||||
@@ -30,13 +30,15 @@ Codex escalation when local tooling is over its head.
|
||||
|
||||
## Operating Model
|
||||
|
||||
1. Local AI gathers context and proposes small changes.
|
||||
2. Work happens on a branch, not directly on `main`.
|
||||
3. The agent reports risk, files inspected, commands run, and confidence.
|
||||
4. Tests/builds decide whether a change is acceptable.
|
||||
5. After two failed local attempts, stop and escalate.
|
||||
6. Codex escalation uses the npm Codex CLI, not the API.
|
||||
7. Human review controls merges.
|
||||
1. Start with `Scripts/linaai_task.sh`, not raw Aider, for normal work.
|
||||
2. Qwen/Ollama performs a preflight risk and confidence check.
|
||||
3. Default confidence threshold is `0.75`.
|
||||
4. High-risk tasks or low-confidence tasks route to Codex automatically.
|
||||
5. Aider runs only for acceptable supervised local work.
|
||||
6. If Aider fails, `Scripts/linaai_task.sh` writes a status file and calls
|
||||
Codex through `Scripts/ai_codex_escalate.sh`.
|
||||
7. Codex escalation uses the npm Codex CLI, not the API.
|
||||
8. Human review controls merges.
|
||||
|
||||
## Codex Escalation
|
||||
|
||||
@@ -44,6 +46,19 @@ Use `Scripts/ai_codex_escalate.sh` with a completed task status file. The
|
||||
script prefers a locally installed `codex` command and falls back to
|
||||
`npx -y @openai/codex exec`.
|
||||
|
||||
For normal tasks, use:
|
||||
|
||||
```bash
|
||||
cd ~/repos/AgrarianGame
|
||||
Scripts/linaai_task.sh "your task here"
|
||||
```
|
||||
|
||||
To test automatic escalation without editing files:
|
||||
|
||||
```bash
|
||||
Scripts/linaai_task.sh --dry-run --force-escalate "Test escalation path only."
|
||||
```
|
||||
|
||||
On `LinaAI`, the npm Codex CLI is installed, but it still needs an authenticated
|
||||
Codex login before cloud escalation can run:
|
||||
|
||||
@@ -54,7 +69,7 @@ codex login
|
||||
|
||||
Codex should be called for:
|
||||
|
||||
- confidence below `0.65`,
|
||||
- confidence below `0.75`,
|
||||
- two failed build/test attempts,
|
||||
- Unreal compile errors that persist,
|
||||
- tasks touching save systems, multiplayer, auth, payments, AGR wallet
|
||||
|
||||
Reference in New Issue
Block a user