mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 04:10:44 +08:00
feat: plan agent v2, global chat mode, and user-mode v2 flag sync
- Add runtime/plan_agent_v2 package and shims; gateway/direct_loop/WS wiring - Admin chat: interaction mode and specialist only in user menu; session API stores memory_mode and execution_mode only - POST /admin/api/chat/user-mode mirrors plan_agent_version to AIA_EXPERT_PLAN_AGENT_V2_ENABLED (v2 to 1, v1 to 0) - Composer cleanup (hidden mode select, no reasoning toggle in meta bar); tests and _local/system.env.example Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ae44cbcad5
commit
37522f492a
49 changed files with 4146 additions and 238 deletions
36
docs/plan_agent_v2_gateway_cutover_patch.md
Normal file
36
docs/plan_agent_v2_gateway_cutover_patch.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Plan Agent V2 Gateway Cutover Draft
|
||||
|
||||
## Purpose
|
||||
- Provide a minimal, reviewable gateway cutover sketch without changing production routing yet.
|
||||
- Keep existing `runtime/gateway.py` behavior unchanged until explicit cutover approval.
|
||||
|
||||
## Draft Helper
|
||||
- New module:
|
||||
- `runtime/plan_agent_v2_gateway_cutover.py`
|
||||
- Entrypoint:
|
||||
- `maybe_handle_expert_turn_v2_draft(...)`
|
||||
|
||||
## Draft Behavior
|
||||
- If v2 shadow is not selected:
|
||||
- returns `handled=False`, gateway should continue legacy flow.
|
||||
- If decision is `enter_plan` or `stay_plan`:
|
||||
- returns `handled=True` with an `OclawGatewayResult` built from v2 shadow compatibility mapper.
|
||||
- If decision is `run_agent`:
|
||||
- returns `handled=False` and provides `system_prompt_override`.
|
||||
- gateway would continue legacy execution path but with injected approved-plan context.
|
||||
|
||||
## Why This Is Safe
|
||||
- No import or call-site changes in `runtime/gateway.py` yet.
|
||||
- Feature remains effectively dormant unless future cutover patch wires this helper.
|
||||
- Existing tests continue to validate legacy and shadow independently.
|
||||
|
||||
## Future Minimal Cutover (single commit)
|
||||
- In `OclawGateway.handle_turn(...)` expert path, add one early branch:
|
||||
1) call `maybe_handle_expert_turn_v2_draft(...)`
|
||||
2) if `handled=True`, return result immediately
|
||||
3) else continue existing flow; if `system_prompt_override` exists, use it as specialist system prompt
|
||||
|
||||
## Rollback
|
||||
- Revert only the gateway wiring commit.
|
||||
- Keep shadow modules and tests as dormant assets.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue