mobile: /goal with pasted text shows a generic HTTP 500 instead of the goal command message
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ios, typescript
調査の方向性
Start with the POST /api/session/{id}/command handler and the built-in opencode.goal plugin, then trace how the mobile composer converts pasted text into files and how the client renders CommandExecutionError.message. Reproduce with the provided empty-text plus data: attachment request before changing either client or server behavior. Done means pasted objectives reach /goal, validation and status errors remain readable, and the mobile client does not replace the response message with a generic HTTP 500 notice.
索引モデルが issue の本文から書いたものです。
説明
Summary
On OpenCode Mobile (iOS) connected to an OpenCode 2.4.2 Windows server, submitting /goal with a pasted objective fails with the generic client error "The server returned HTTP 500." The pasted text is silently converted into a text-file attachment, so the goal command receives an empty argument; the built-in opencode.goal command then reports status/usage as a command error, which POST /api/session/{id}/command maps to HTTP 500 CommandExecutionError (its documented 500 schema). The response body's message carries the real reason, but the mobile client shows only the generic HTTP text. Goal Mode is therefore effectively unusable from the phone for pasted (long) objectives.
Environment
- opencode version: server 2.4.2 (background service); CLI 2.4.1 (npm shim, minor mismatch)
- Client: OpenCode Mobile (iOS) paired to a Windows server over the remote tunnel. Comparison client: desktop/API (
opencode api) - Model and provider: Not relevant (fails before any model call)
- OS: Windows_NT 10.0.19045 (win32 x64) (server host); iOS client version Unavailable at filing time (manual check pending)
- Terminal: Unavailable: terminal environment variables are not set
- Shell: C:\Windows\system32\cmd.exe
- Install/channel: latest
- Active plugins: one local plugin (
sitecode, file:// install; registers only acontexthook — it does not touch commands). The goal command is the built-inopencode.goalplugin.
Reproduction
Deterministic API equivalent (no model calls):
POST /api/session— create a disposable session.POST /api/session/{id}/commandwith body
{"name":"goal","text":"","files":[{"uri":"data:text/plain;base64,RGlzcG9zYWJsZSB0ZXN0IHBhc3Rl","name":"pasted.txt"}]}
(this is what the mobile composer produces when a long prompt is pasted after/goal)- Observe the 500 response.
On-device reproduction:
- Pair OpenCode Mobile with the server and open any session.
- Type
/goaland paste a long prompt (the composer converts the paste into a text-file attachment, leaving the argument empty). - Submit. Observe: "The server returned HTTP 500."
Related triggers through the same error channel (all reproducible via the same endpoint):
- Inline objective of 4,100 characters:
{"name":"goal","text":"<4100 chars>"}→ 500A goal objective is limited to 4000 characters (got 4100). - Bare
/goalwith an existing goal: 500Goal active: <objective>\nUsage: /goal <objective> | pause | resume | clear /goal pausewith no goal: 500No active goal to pause.
Expected Behavior
- A pasted objective should either be used as the goal objective (the goal command already supports attachments:
/goalwith files routes the kickoff throughctx.session.prompt), or the client should surface the command error message. - Command validation/status messages should reach the user as readable text (4xx or success payload), not as a generic HTTP 500 notice.
Actual Behavior
POST /api/session/{id}/command
{"name":"goal","text":"","files":[{"uri":"data:text/plain;base64,…","name":"pasted.txt"}]}
HTTP/1.1 500 Internal Server Error
{"_tag":"CommandExecutionError","command":"goal","message":"Usage: /goal <objective> | pause | resume | clear"}
Server log (redacted):
level=ERROR message="command execution failed" command=goal error="Error: Goal achieved: <objective>\n<reason>\nUsage: /goal <objective> | pause | resume | clear"
level=INFO message="Sent HTTP response" http.method=POST http.url=/api/session/{id}/command http.status=500
The mobile client displays only "The server returned HTTP 500."; desktop/TUI display the message (per PR #59437, "a failure shows an error toast" / "a bare /goal returns the status and usage as the command error").
Native Goal Mode itself works on 2.4.2 (verified: creation returns 204, state read back as status:"active" then "complete", synthetic {"source":"goal","goalID":…} activation messages present, pause/resume/clear all succeed).
Additional Context
Three distinct defects/risks stack here:
- Mobile composer: pasted text becomes a text-file attachment and the command argument becomes empty (
{"name":"goal","text":"","files":[…]}— verified by inspecting the stored user message:text:""plus adata:file attachment). The composer can also drop the attachment entirely before send: a message that was intended with an attached prompt was admitted withfiles:[]and client admission metadataattachments:[]— the file never entered the payload (request bodies are not logged server-side, but the client's own empty attachment metadata is decisive), so no server-side handling can recover it. - Goal command error channel: empty argument, objective > 4,000 chars (
MAX_OBJECTIVE), andpause/resume/clearmisuse allEffect.fail(...), andPOST /api/session/{id}/commandmaps every command error to HTTP 500CommandExecutionError(documented in the endpoint's OpenAPI). Suggestion: return these as 400 withmessage, or return goal status as a success payload for bare/goal. - Mobile error display: the client shows the generic HTTP line instead of
CommandExecutionError.messagefrom the body.
Separate contract observation: POST /api/rpc/{rpcID}/{method} uses the documented Rpc.Input envelope ({"input": …}, response {"output": …}). Sending the bare method input ({"sessionID":"ses_…"}) returns 400 rpc.invalid_input: "Expected object". 18 POST /api/rpc/opencode.goal/get calls in our server log all returned 400 this way (caller not identifiable from logs); if any client polls goal state unwrapped, it can never render the goal pill/status. This may also explain "goals not created or shown" in #64469.
Related issues: #64469 (mobile slash commands not routed at all on app 0.8.0 / server 2.3.0 — different failure: there the command reaches the model as plain text; here it does reach the command endpoint), #62366 (goal status/aliases), #49803 (app slash-command parity).
Workaround until fixed: type the objective inline after /goal (never paste), keep it ≤ 4,000 characters, and use a two-stage flow for long instructions (send the spec as a normal message/file first, then a short typed /goal <objective referencing it>).
- 主要言語
- TypeScript
- スター
- 230k
- フォーク
- 31.3k
- 平均マージ
- 5時間 32分
- マージ済み PR(30日)
- 453
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
anomalyco/opencode#67064 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 82/100
anomalyco/opencode#67009 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#67001 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log対応中かも @liwenjie200543 が 2 日前に担当しました。 オープンarea/plugins platform/linux reproduced type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66970 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks対応中かも @argszero が 2 日前に担当しました。 オープンarea/tui platform/wsl status/repro-simulated type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#66773 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tashfeenahmed/freellmapi#2169 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vercel-labs/ui#1563 ·
メンテナーはふだん 1 日以内に返信