New chats do not reuse recent models or follow Desktop model-selection precedence
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with SessionsViewModel.startNewSession/create, RemoteSessionRepository.create, and AgentInfo.toDomain in ResourceMapping.kt; compare their behavior with the Desktop selection precedence linked in the issue. Trace how agent and global defaults, recent models, and server fallback are resolved, then add coverage for the listed precedence and session-isolation cases. Done means new chats follow the stated precedence while existing chats retain their selections.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened?
When switching between chats and starting a new session without manually selecting a model, the model used feels unpredictable: it does not follow the last-used model as expected.
In the reported example, a new Plan chat used GPT-6.1 Terra · GitHub Copilot. Sending Test failed with Provider request failed with HTTP 401. The 401 is an observed provider-authentication error, not proof that model selection itself caused the authentication failure.
Steps to reproduce
- Use a model in an existing chat.
- Switch chats and start a new session without explicitly choosing a model.
- Send a prompt and inspect which model is used.
Expected behavior
Use predictable selection consistent with OpenCode Desktop, with as little mobile-owned configuration as possible:
- Explicit selection for the new chat.
- Server-configured model for the selected agent (e.g. Plan/Build).
- Explicit global server model configuration.
- Last-used model that is still available.
- Server-owned fallback. If no configuration or history exists, prefer an available free OpenCode model where supported by the server policy, without hard-coding model IDs in mobile.
Existing chats should retain their own selections; opening a chat should not silently replace its model with another chat's recent model.
Source investigation
SessionsViewModel.startNewSession/createleaves the new model null unless manually selected. Recent models populate the picker but are not used to initialize the selection.RemoteSessionRepository.createforwards that optional model to the server. No random selection was found in this mobile path: an unspecified model delegates resolution to the server.- The pinned API contract and generated
ModelApialready exposeGET /api/model/default, but mobile does not consume it. AgentInfo.toDomaininResourceMapping.ktdoes not retain the agent's model configuration.- Current Desktop new-chat selection explicitly resolves draft selection → agent model → configured global model → valid recent model → connected-provider fallback, then sends the resolved model when creating the session:
This is a source-based explanation of the behavior gap, not a live trace proving why that specific Copilot model was resolved. Upstream links refer to the inspected current commit, not a verified checkout of server 2.1.4.
Suggested approach / alternatives
Prefer existing server APIs and agent configuration; keep only minimal recent-selection state on mobile, scoped to the server. Do not add a second mobile model-configuration system.
Continuing to omit the model delegates everything to the server but does not reproduce Desktop's recent-model behavior. Conversely, always taking /api/model/default before recents is not necessarily equivalent either: it can return an implicit fallback, not just an explicitly configured global default. Distinguish explicit configuration from fallback when applying Desktop's precedence.
Verification
Cover agent-specific and global defaults, recent-model fallback, removed/unavailable recent models, no-history fallback, Plan/Build switching, reopening existing sessions, and isolation between servers.
Environment
- App: 0.9.0 (latest published release, as requested by reporter)
- OpenCode server: 2.1.4 (reported)
- Device: Samsung Galaxy S23+
- Android: 16, One UI 8.5
Screenshot
- Lenguaje dominante
- Kotlin
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 11 h 35 min
- PR fusionados (30 d)
- 48
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de beppe2880/opencode-mobile
-
Background shell polling and reconnect attempts continue when hidden or offlinePosiblemente ocupada @gnacho la tomó hoy. Abiertoneeds:compliance
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
beppe2880/opencode-mobile#111 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
platform:android
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
beppe2880/opencode-mobile#110 ·
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
beppe2880/opencode-mobile#109 ·
Los mantenedores suelen responder en 1 día
-
platform:android platform:ios
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
beppe2880/opencode-mobile#108 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
beppe2880/opencode-mobile#106 ·
Los mantenedores suelen responder en 1 día
Todos los issues de beppe2880/opencode-mobile
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tiann/hapi#2253 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
pengchujin/aerial-tv#1074 ·
Los mantenedores suelen responder en 1 día
-
[Request] 多闪Abiertorequest-adaption
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
BetterAndroid/android-notification-icon-project#814 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100