跳轉到

OMP 遠端 Coding Agent(2/5):模型角色與日常 Coding

摘要

不同工作交給不同模型,再用清楚的 Prompt 讓 Agent 照步驟做事。本篇也說明怎麼接續和分支 Session。

資料基準:2026-09。執行前請以 omp --help、omp config list 與 omp models 核對目前版本支援的選項。

系列目錄
  1. 概念、架構與安裝
  2. 模型角色與日常 Coding
  3. Collab 遠端控制
  4. 設定、權限與安全
  5. 手機通知與日常流程
  6. 指令速查表(本機)
  7. 指令速查表(網頁)

1. OMP 的 Model Roles

OMP 可按工作類型切換模型。常見角色:

Role 用途
default 日常主要 Coding
smol 快速、低成本工作
slow 深度推理、疑難除錯
plan 規劃與架構分析
vision 圖片 / 視覺相關
advisor 第二模型 Review
task Subagent 工作
designer 設計相關

範例:

modelRoles:
  default: anthropic/claude-sonnet-4-5
  smol: openai/gpt-4.1-mini
  slow: anthropic/claude-opus-4-5:high

上述模型名稱僅示範設定格式;實際名稱請以 omp models 的清單為準。


2. 模型切換

進入 OMP:

omp

在互動介面輸入:

/model

也可在啟動時指定:

omp --model <provider>/<model>

或:

omp --model slow

或使用 Role 參照寫法:

omp --model @slow

Role Cycle

設定:

cycleOrder:
  - smol
  - default
  - slow

設定後可在這三個 Role 間切換。

模型選擇策略

模型角色切換策略

圖 1:模型角色切換策略

可依工作量選擇 Role:

smol
→ 搜尋
→ 小改動
→ 低成本 subtask

default
→ 日常 Coding
→ Feature 開發
→ 一般 Debug

slow
→ Architecture
→ Difficult debugging
→ Security analysis

plan
→ 需求拆解
→ Implementation plan

3. Thinking Level

如果模型支援 reasoning:

omp --thinking high

常見等級:

off
minimal
low
medium
high
xhigh

是否真正支援取決於 Provider / Model。


4. 基本使用

進入專案:

cd ~/Projects/my-project

啟動:

omp

範例 Prompt:

先閱讀整個專案架構。

不要修改任何檔案。

請說明:
1. frontend
2. backend
3. database
4. API
5. authentication

彼此之間的關係。

Debug:

找出 login API 為什麼偶爾會出現 500。

先:
1. 重現
2. 找 root cause
3. 分析影響範圍

在我確認之前不要修改程式。

修改:

執行剛才的修正。

完成後:
1. 跑相關 tests
2. 顯示失敗測試
3. 顯示 git diff summary
4. 不要 commit
5. 不要 push

5. 建議的 Prompt 模板

不要只輸入:

fix bug

推薦:

分析這個 bug。

要求:

1. 先重現問題
2. 找 root cause
3. 在修改前先說明計畫
4. 列出可能受影響檔案
5. 修改後跑 tests
6. 檢查 regression
7. 最後輸出 git diff summary
8. 不要 push

大型工作:

orchestrate

完成 payment service refactor。

要求:

1. 分析現有 architecture
2. 建立 implementation plan
3. 拆成適合平行處理的工作
4. 實作
5. 執行相關測試
6. Review git diff
7. 不要 push

6. Session 保存與繼續

正常啟動:

omp

繼續最近 session:

omp --continue

或:

omp -c

從歷史 session 選:

omp --resume

指定 session:

omp --resume <session-id>

Fork:

omp --fork <session>

上一篇:概念、架構與安裝 · 下一篇:Collab 遠端控制

參考資料