loki-mode 4.2.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,77 @@
1
1
  # Model Selection & Task Tool
2
2
 
3
+ ## Multi-Provider Support (v5.0.0)
4
+
5
+ Loki Mode supports three AI providers. Claude has full features; Codex and Gemini run in **degraded mode** (sequential execution only, no Task tool, no parallel agents).
6
+
7
+ | Provider | Full Features | Degraded | CLI Flag |
8
+ |----------|---------------|----------|----------|
9
+ | **Claude Code** | Yes | No | `--provider claude` (default) |
10
+ | **OpenAI Codex CLI** | No | Yes | `--provider codex` |
11
+ | **Google Gemini CLI** | No | Yes | `--provider gemini` |
12
+
13
+ **Degraded mode limitations:**
14
+ - No Task tool (cannot spawn subagents)
15
+ - No parallel execution (sequential RARV cycle only)
16
+ - No MCP server integration
17
+ - Single model with parameter adjustment (effort/thinking level)
18
+
19
+ ---
20
+
21
+ ## Abstract Model Tiers
22
+
23
+ | Tier | Purpose | Claude | Codex | Gemini |
24
+ |------|---------|--------|-------|--------|
25
+ | **planning** | PRD analysis, architecture, system design | opus | effort=xhigh | thinking=high |
26
+ | **development** | Feature implementation, complex bugs, tests | sonnet | effort=high | thinking=medium |
27
+ | **fast** | Unit tests, docs, linting, simple tasks | haiku | effort=low | thinking=low |
28
+
29
+ ---
30
+
3
31
  ## Model Selection by SDLC Phase
4
32
 
5
- | Model | SDLC Phases | Examples |
6
- |-------|-------------|----------|
7
- | **Opus 4.5** | Bootstrap, Discovery, Architecture | PRD analysis, system design, technology selection, API contracts |
8
- | **Sonnet 4.5** | Development, QA, Deployment | Feature implementation, complex bugs, integration/E2E tests, code review, deployment |
9
- | **Haiku 4.5** | All other operations (parallel) | Unit tests, docs, bash commands, linting, monitoring |
33
+ | Tier | SDLC Phases | Examples |
34
+ |------|-------------|----------|
35
+ | **planning** | Bootstrap, Discovery, Architecture | PRD analysis, system design, technology selection, API contracts |
36
+ | **development** | Development, QA, Deployment | Feature implementation, complex bugs, integration/E2E tests, code review, deployment |
37
+ | **fast** | All other operations (parallel for Claude) | Unit tests, docs, bash commands, linting, monitoring |
10
38
 
11
- ## Task Tool Examples
39
+ **Claude-specific model names:** opus, sonnet, haiku
40
+ **Codex effort levels:** xhigh, high, medium, low
41
+ **Gemini thinking levels:** high, medium, low
42
+
43
+ ## Task Tool Examples (Claude Only)
44
+
45
+ **NOTE:** Task tool is Claude-specific. Codex and Gemini run in degraded mode without subagents.
12
46
 
13
47
  ```python
14
- # Opus for Bootstrap, Discovery, Architecture (planning ONLY)
48
+ # Planning tier (opus) for Bootstrap, Discovery, Architecture
15
49
  Task(subagent_type="Plan", model="opus", description="Design system architecture", prompt="...")
16
50
  Task(subagent_type="Plan", model="opus", description="Analyze PRD requirements", prompt="...")
17
51
 
18
- # Sonnet for Development, QA, and Deployment
52
+ # Development tier (sonnet) for Development, QA, and Deployment
19
53
  Task(subagent_type="general-purpose", model="sonnet", description="Implement API endpoint", prompt="...")
20
54
  Task(subagent_type="general-purpose", model="sonnet", description="Write integration tests", prompt="...")
21
55
  Task(subagent_type="general-purpose", model="sonnet", description="Deploy to production", prompt="...")
22
56
 
23
- # Haiku for everything else (PREFER for parallelization)
57
+ # Fast tier (haiku) for everything else (PREFER for parallelization)
24
58
  Task(subagent_type="general-purpose", model="haiku", description="Run unit tests", prompt="...")
25
59
  Task(subagent_type="general-purpose", model="haiku", description="Check service health", prompt="...")
26
60
  ```
27
61
 
62
+ ### Provider Detection in Code
63
+
64
+ ```bash
65
+ # In run.sh, check provider before using Task tool
66
+ if [ "${PROVIDER_HAS_TASK_TOOL:-false}" = "true" ]; then
67
+ # Claude: Use Task tool with parallel agents
68
+ Task(model="haiku", description="Run tests", prompt="...")
69
+ else
70
+ # Codex/Gemini: Run sequentially without subagents
71
+ # Execute RARV cycle in main thread
72
+ fi
73
+ ```
74
+
28
75
  ## Task Categories
29
76
 
30
77
  **Opus (Bootstrap -> Architecture - Planning ONLY):**
@@ -45,14 +92,20 @@ Task(subagent_type="general-purpose", model="haiku", description="Check service
45
92
  - File operations, linting, static analysis
46
93
  - Monitoring, health checks, log analysis
47
94
 
48
- ## Parallelization Strategy
95
+ ## Parallelization Strategy (Claude Only)
96
+
97
+ **NOTE:** Parallelization requires Task tool, which is Claude-specific. Codex and Gemini run sequentially.
49
98
 
50
99
  ```python
51
- # Launch 10+ Haiku agents in parallel for unit test suite
100
+ # Claude: Launch 10+ Haiku agents in parallel for unit test suite
52
101
  for test_file in test_files:
53
102
  Task(subagent_type="general-purpose", model="haiku",
54
103
  description=f"Run unit tests: {test_file}",
55
104
  run_in_background=True)
105
+
106
+ # Codex/Gemini: Run tests sequentially (no parallelization)
107
+ for test_file in test_files:
108
+ run_test(test_file) # Sequential execution
56
109
  ```
57
110
 
58
111
  ## Extended Thinking Mode
@@ -0,0 +1,184 @@
1
+ # Multi-Provider Support
2
+
3
+ Loki Mode v5.0.0 supports three AI providers for autonomous execution.
4
+
5
+ ## Provider Comparison
6
+
7
+ > **Note:** The model names for Codex (`gpt-5.2-codex`) and Gemini (`gemini-3-pro-medium`) are placeholder values. Update the provider configuration files (`providers/codex.sh` and `providers/gemini.sh`) with actual model identifiers when official CLI documentation becomes available.
8
+
9
+ > **CLI Flags Verified:** The autonomous mode flags have been verified against actual CLI help output:
10
+ > - Claude: `--dangerously-skip-permissions` (verified)
11
+ > - Codex: `exec --dangerously-bypass-approvals-and-sandbox` (verified v0.89.0)
12
+ > - Gemini: `--yolo` (verified v0.25.2) - Note: `-p` prompt flag is deprecated, using positional prompts
13
+
14
+ | Feature | Claude Code | OpenAI Codex | Gemini CLI |
15
+ |---------|-------------|--------------|------------|
16
+ | **Full Features** | Yes | No (Degraded) | No (Degraded) |
17
+ | **Task Tool (Subagents)** | Yes | No | No |
18
+ | **Parallel Agents** | Yes (10+) | No | No |
19
+ | **MCP Integration** | Yes | No | No |
20
+ | **Context Window** | 200K | 128K | 1M |
21
+ | **Model Tiers** | 3 (opus/sonnet/haiku) | 1 (effort param) | 1 (thinking param) |
22
+ | **Skill Directory** | ~/.claude/skills | None | None |
23
+
24
+ ## Provider Selection
25
+
26
+ ```bash
27
+ # Via environment variable
28
+ export LOKI_PROVIDER=claude # or codex, gemini
29
+
30
+ # Via CLI flag
31
+ ./autonomy/run.sh --provider codex ./prd.md
32
+ loki start --provider gemini ./prd.md
33
+ ```
34
+
35
+ ## Claude Code (Default, Full Features)
36
+
37
+ **Best for:** All use cases. Full autonomous capability.
38
+
39
+ **Capabilities:**
40
+ - Task tool for spawning subagents
41
+ - Parallel execution (10+ agents simultaneously)
42
+ - MCP server integration
43
+ - Three distinct models (opus/sonnet/haiku)
44
+ - 200K context window
45
+
46
+ **Invocation:**
47
+ ```bash
48
+ claude --dangerously-skip-permissions -p "$prompt"
49
+ ```
50
+
51
+ **Model Selection:**
52
+ ```python
53
+ Task(model="opus", ...) # Planning tier
54
+ Task(model="sonnet", ...) # Development tier
55
+ Task(model="haiku", ...) # Fast tier (parallelize)
56
+ ```
57
+
58
+ ---
59
+
60
+ ## OpenAI Codex CLI (Degraded Mode)
61
+
62
+ **Best for:** Teams standardized on OpenAI. Accepts feature tradeoffs.
63
+
64
+ **Limitations:**
65
+ - No Task tool (cannot spawn subagents)
66
+ - No parallel execution (sequential only)
67
+ - No MCP integration
68
+ - Single model with effort parameter
69
+ - 128K context window
70
+
71
+ **Invocation:**
72
+ ```bash
73
+ codex exec --dangerously-bypass-approvals-and-sandbox "$prompt"
74
+ ```
75
+
76
+ **Model Tiers via Effort (env var, not CLI flag):**
77
+
78
+ Note: Codex does not support `--effort` as a CLI flag. Reasoning effort must be configured via environment variable or config file.
79
+
80
+ ```bash
81
+ # Set effort via environment
82
+ CODEX_MODEL_REASONING_EFFORT=high codex exec --dangerously-bypass-approvals-and-sandbox "$prompt"
83
+ ```
84
+
85
+ | Tier | Effort | Use Case |
86
+ |------|--------|----------|
87
+ | planning | xhigh | Architecture, PRD analysis |
88
+ | development | high | Feature implementation, tests |
89
+ | fast | low | Simple fixes, docs |
90
+
91
+ ---
92
+
93
+ ## Google Gemini CLI (Degraded Mode)
94
+
95
+ **Best for:** Teams standardized on Google. Large context needs (1M tokens).
96
+
97
+ **Limitations:**
98
+ - No Task tool (cannot spawn subagents)
99
+ - No parallel execution (sequential only)
100
+ - No MCP integration
101
+ - Single model with thinking_level parameter
102
+ - 1M context window (largest)
103
+
104
+ **Invocation:**
105
+ ```bash
106
+ # Note: -p flag is DEPRECATED. Using positional prompt.
107
+ gemini --yolo "$prompt"
108
+ ```
109
+
110
+ **Model Tiers via Thinking Level (settings.json, not CLI flag):**
111
+
112
+ Note: Gemini CLI does not support `--thinking-level` as a CLI flag. Thinking mode must be configured in `~/.gemini/settings.json`.
113
+
114
+ ```json
115
+ // ~/.gemini/settings.json
116
+ {
117
+ "thinkingMode": "medium" // high, medium, low
118
+ }
119
+ ```
120
+
121
+ | Tier | Thinking | Use Case |
122
+ |------|----------|----------|
123
+ | planning | high | Architecture, PRD analysis |
124
+ | development | medium | Feature implementation, tests |
125
+ | fast | low | Simple fixes, docs |
126
+
127
+ ---
128
+
129
+ ## Degraded Mode Behavior
130
+
131
+ When running with Codex or Gemini:
132
+
133
+ 1. **RARV Cycle executes sequentially** - No parallel agents
134
+ 2. **Task tool calls are skipped** - Main thread handles all work
135
+ 3. **Model tier maps to provider configuration:**
136
+ - Codex: `CODEX_MODEL_REASONING_EFFORT` env var (xhigh/high/medium/low)
137
+ - Gemini: `~/.gemini/settings.json` thinkingMode (high/medium/low)
138
+ 4. **Quality gates run sequentially** - No 3-reviewer parallel review
139
+ 5. **Git worktree parallelism disabled** - `--parallel` flag has no effect
140
+
141
+ **Example output:**
142
+ ```
143
+ [INFO] Provider: OpenAI Codex CLI (codex)
144
+ [WARN] Degraded mode: Parallel agents and Task tool not available
145
+ [INFO] Limitations:
146
+ [INFO] - No Task tool subagent support - cannot spawn parallel agents
147
+ [INFO] - Single model with effort parameter - no cheap tier for parallelization
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Provider Configuration Files
153
+
154
+ Provider configs are shell-sourceable files in `providers/`:
155
+
156
+ ```
157
+ providers/
158
+ claude.sh # Full-featured provider
159
+ codex.sh # Degraded mode, effort parameter
160
+ gemini.sh # Degraded mode, thinking_level parameter
161
+ loader.sh # Provider loader utility
162
+ ```
163
+
164
+ **Key variables:**
165
+ ```bash
166
+ PROVIDER_NAME="claude"
167
+ PROVIDER_HAS_SUBAGENTS=true
168
+ PROVIDER_HAS_PARALLEL=true
169
+ PROVIDER_HAS_TASK_TOOL=true
170
+ PROVIDER_DEGRADED=false
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Choosing a Provider
176
+
177
+ | If you need... | Choose |
178
+ |----------------|--------|
179
+ | Full autonomous capability | Claude |
180
+ | Parallel agent execution | Claude |
181
+ | MCP server integration | Claude |
182
+ | OpenAI ecosystem compatibility | Codex |
183
+ | Largest context window (1M) | Gemini |
184
+ | Sequential-only is acceptable | Codex or Gemini |