Summary
When using the iOS client with OpenCode Server 1.15.12, newly-created sessions can accept a user message in the UI but never produce a response. The server receives the prompt_async request and returns HTTP 204, but the async backend task fails with SQLITE_CONSTRAINT_NOTNULL.
Existing older sessions may continue to work, which makes this look like a session-specific or network issue at first.
Environment
- OpenCode Server: 1.15.12
- iOS client: current TestFlight / repository behavior
- Connection: HTTPS via Tailscale Serve with Basic Auth
- Model tested:
openai/gpt-5.5
Reproduction
- Start OpenCode server 1.15.12.
- Connect from the iOS client over HTTPS.
- Create a new session from the iOS client.
- Send a message in that new session.
- Observe that the message appears to send, but no assistant response arrives.
Observed Behavior
The client request to POST /session/{sessionID}/prompt_async returns 204 No Content, so the iOS UI treats the send as successful.
The server then logs an async failure similar to:
ERROR service=default session.id=... cause={... "code":"SQLITE_CONSTRAINT_NOTNULL" ...} prompt_async failed
The relevant database table has NOT NULL columns:
CREATE TABLE session_input (
id text PRIMARY KEY,
session_id text NOT NULL,
prompt text NOT NULL,
delivery text NOT NULL,
admitted_seq integer NOT NULL,
promoted_seq integer,
time_created integer NOT NULL
);
Expected Behavior
New sessions created from the iOS client should be able to send prompts and receive assistant responses on OpenCode Server 1.15.12.
Likely Cause
The iOS client appears to send the older prompt_async payload shape. It sends text parts, agent, and model, but does not send a messageID or per-part id.
The current OpenCode Web client generated API call supports/sends fields including:
messageID in the body
parts[].id in the body
directory query parameter
- optional
variant
The missing messageID is the strongest suspect because OpenCode 1.15.12 now queues async prompts through session_input, whose id is NOT NULL.
Suggested Fix
Update the iOS client request shape to match the current Web client behavior:
- Generate a server-style user message id, e.g.
msg_<uuid>
- Generate a part id, e.g.
part_<uuid>
- Include
messageID in the prompt_async JSON body
- Include
id on text parts
- Include the active session/project
directory as a query parameter on session creation and prompt submission
Approximate body shape:
{
"messageID": "msg_...",
"parts": [
{
"id": "part_...",
"type": "text",
"text": "hello"
}
],
"agent": "build",
"model": {
"providerID": "openai",
"modelID": "gpt-5.5"
}
}
Notes
This does not appear to be a transport/auth problem: HTTPS, Basic Auth, and older sessions work. The failure happens after prompt_async is accepted, inside the server async processing path.
Summary
When using the iOS client with OpenCode Server 1.15.12, newly-created sessions can accept a user message in the UI but never produce a response. The server receives the
prompt_asyncrequest and returns HTTP 204, but the async backend task fails withSQLITE_CONSTRAINT_NOTNULL.Existing older sessions may continue to work, which makes this look like a session-specific or network issue at first.
Environment
openai/gpt-5.5Reproduction
Observed Behavior
The client request to
POST /session/{sessionID}/prompt_asyncreturns204 No Content, so the iOS UI treats the send as successful.The server then logs an async failure similar to:
The relevant database table has NOT NULL columns:
Expected Behavior
New sessions created from the iOS client should be able to send prompts and receive assistant responses on OpenCode Server 1.15.12.
Likely Cause
The iOS client appears to send the older
prompt_asyncpayload shape. It sends text parts, agent, and model, but does not send amessageIDor per-partid.The current OpenCode Web client generated API call supports/sends fields including:
messageIDin the bodyparts[].idin the bodydirectoryquery parametervariantThe missing
messageIDis the strongest suspect because OpenCode 1.15.12 now queues async prompts throughsession_input, whoseidis NOT NULL.Suggested Fix
Update the iOS client request shape to match the current Web client behavior:
msg_<uuid>part_<uuid>messageIDin theprompt_asyncJSON bodyidon text partsdirectoryas a query parameter on session creation and prompt submissionApproximate body shape:
{ "messageID": "msg_...", "parts": [ { "id": "part_...", "type": "text", "text": "hello" } ], "agent": "build", "model": { "providerID": "openai", "modelID": "gpt-5.5" } }Notes
This does not appear to be a transport/auth problem: HTTPS, Basic Auth, and older sessions work. The failure happens after
prompt_asyncis accepted, inside the server async processing path.