goal: warn before sending an objective over 4,000 characters
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 50/100
Piste de recherche
Start in server/src/main/kotlin/ai/opencode/server/live/LiveCatalog.kt (lines 61-109), where commands like goal are loaded, and in SessionFeatureState.kt to find where the composer draft is sent. The 4,000-character limit is defined in packages/core/src/plugin/goal.ts on the server side. Read LiveTransport.kt (lines 144-153 and 313-318) to see why non-2xx bodies are dropped. Done means a 4,001-character objective shows a warning before the request, a 4,000-character one sends, the draft is kept, and a server rejection shows its own message.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Android does not validate the /goal objective length before sending. An objective over the server's 4,000-character limit is submitted to /api/session/{id}/command; the server rejects it with CommandExecutionError (HTTP 500), but Android discards the response body and shows only “The server returned HTTP 500.” The user gets no warning that the input exceeded the limit.
Environment
- Android app: reporter's build not provided; behavior confirmed in
v0.8.8(c2311a60337e2a2128baba7c6eccb61b22bdb3f7) anddev(cab26e54c453fbaf8683ec456e628539d64b325f) source. - OpenCode server: version not provided; requires a server that advertises
goalin/api/command. - Device/OS: not provided.
- Terminal/shell: not applicable; reproduced through the Android composer.
- Active plugins: none required; uses the server's built-in
/goalcommand.
Reproduction
- Pair the Android app with an OpenCode server whose
/api/commandresponse includesgoal. - Start a session draft, type
/, and select thegoalcommand chip. - Paste an objective longer than 4,000 characters into the draft.
- Tap Send without shortening it.
Expected Behavior
Before the network request, the composer warns that the objective exceeds 4,000 characters, keeps the draft intact, and lets the user edit it. If the server still rejects the command, Android shows the server's specific validation message instead of a generic HTTP status.
Actual Behavior
No pre-send warning appears. The command request is sent, the server returns HTTP 500, and the composer reports “The server returned HTTP 500.” The response explaining the 4,000-character limit is not shown.
Additional Context
- The server limit is defined in
packages/core/src/plugin/goal.tsand enforced when the command runs. - Android loads commands dynamically in
server/src/main/kotlin/ai/opencode/server/live/LiveCatalog.kt:61-109; there is no/goal-specific validation or state UI. - The context gauge cannot provide this warning:
SessionFeatureState.kt:451-463calculates it from the last assistant token usage, not the current composer draft. - Non-2xx response bodies are discarded by
server/src/main/kotlin/ai/opencode/server/live/LiveTransport.kt:144-153,313-318, so command validation details are lost. - Suggested acceptance checks: 4,000 and 4,001 characters, draft preservation, accessible warning text, and a command failure that preserves the server's error message.
- Static source reproduction only; no device screenshot or log was provided.
- Langage dominant
- Kotlin
- Étoiles
- 146
- Forks
- 35
- Merge moyen
- 7 h 41 min
- PR mergées (30 j)
- 221
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de anomalyco/opencode-android
-
F-droid releaseOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
anomalyco/opencode-android#345 ·
Les mainteneurs répondent en général sous 1 jour
-
Crash: IllegalStateException in AppContext.getLiveValuePeut-être pris @Tarquinen l’a pris il y a 1 jour. Ouvertecrash crash-triaged
Difficulté 3/5 Une demi-journée Accessibilité débutants 65/100
anomalyco/opencode-android#343 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
crash crash-needs-human crash-triaged
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
anomalyco/opencode-android#341 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
crash crash-needs-human crash-triaged
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
anomalyco/opencode-android#340 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Crash: OutOfMemoryError in LiveTransportKt$awaitResponse$2$2.onResponsePeut-être pris @Tarquinen l’a pris il y a 3 jours. Ouvertecrash crash-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
anomalyco/opencode-android#320 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de anomalyco/opencode-android
Issues similaires
-
[Request]: KylleneOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
ScoopInstaller/Extras#19589 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
difficulty: beginner documentation help wanted networking
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
feature request needs decision
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
tswistak/Battery-Monitor#207 ·
Les mainteneurs répondent en général sous 1 jour