agent picker: existing sessions ignore configured model variants

Đang mở
#309 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

Start in feature/session/src/main/kotlin/ai/opencode/feature/session/SessionFeatureAgents.kt around lines 133-146, where an agent pick in an existing session updates only sessionAgents, and compare it with the draft path that calls pickingDraftAgent. Then read SessionFeatureDelivery.kt lines 316-350 to see when a model switch is sent. Done when an agent pick in an established session carries that agent's configured model and variant to the next send, and the agent-only test in SessionFeatureTestsAgentSelection.kt is updated to match.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

This is a follow-up to #202 / #210, which fixed per-agent model and reasoning-variant defaults for new-session drafts only. In an existing session, changing the selected agent does not change the model or its variant. The next send switches the agent but leaves the previous model level active, so an agent configured for #max can run at the prior agent's model and level.

Environment

  • Android app: reporter's build not provided; behavior confirmed in v0.8.8 (c2311a60337e2a2128baba7c6eccb61b22bdb3f7) and dev (cab26e54c453fbaf8683ec456e628539d64b325f) source.
  • OpenCode server: version not provided; requires per-agent model values in opencode.jsonc.
  • Device/OS: not provided.
  • Terminal/shell: not applicable.
  • Active plugins: none required.

Reproduction

  1. Configure two agents with different models and variants, for example:

    {
      "$schema": "https://opencode.ai/config.json",
      "agents": {
        "build": { "model": "opencode-go/deepseek-v4.1-flash#max" },
        "plan": { "model": "anthropic/claude-opus-5.5" }
      }
    }
    
  2. In Android Settings › Sessions, enable Agent Selection.

  3. Start a session with build and verify the composer shows its configured model at max.

  4. In that existing session, switch the agent chip to plan.

  5. Send a message.

Expected Behavior

The composer and server session switch to plan's configured model and variant. Switching back to build restores its configured max level, unless the user explicitly chooses another model for that agent.

Actual Behavior

The agent chip changes, but the model chip keeps the previous model and variant. Delivery calls switchAgent; it does not call switchModel because the agent pick created no pending model. The prompt therefore runs on the old model level.

Additional Context

  • #202 covered new drafts, and merged PR #210 explicitly says “Existing sessions are unchanged.”
  • feature/session/src/main/kotlin/ai/opencode/feature/session/SessionFeatureAgents.kt:133-146 updates only sessionAgents when session != null; the draft-only path calls pickingDraftAgent.
  • Per-agent manual model memory is also draft-only (SessionFeatureAgents.kt:45-48,277-289).
  • SessionFeatureDelivery.kt:316-350 switches the agent first and switches a model only when pending.model is non-null.
  • Existing-session tests assert an agent-only request sequence (SessionFeatureTestsAgentSelection.kt:241-287).
  • Suggested acceptance checks: switch away and back in an established session, configured variant propagation, explicit user model picks, and agent/model request ordering on the next send.
  • Static source reproduction only; no device screenshot or log was provided.
Ngôn ngữ chính
Kotlin
Star
146
Fork
35
Merge trung bình
7 giờ 41 phút
Pull request đã merge (30 ngày)
221

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode-android

Tất cả issue của anomalyco/opencode-android

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.