chaitin / chaitin/MonkeyCode

Diagnosis: Chat attachment (.txt) never reached the agent session

Open
#1,021 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.7k
Forks
719
Avg merge
4h 30m
Merged PRs (30d)
83

Description

Diagnosis: Chat attachment (.txt) never reached the agent session
Date: 2026-08-07

Reporter: user via workspace chat

Status: confirmed with session data

Symptom
User clicked "upload attachment" in the chat UI and attached a .txt file with the comment "upload this file for futur use".
The agent never received the file. No file content or metadata appeared in the agent context.
The agent appeared to "think" for a long time while having nothing to act on.
Evidence
Session data was inspected at /root/.local/share/opencode/opencode.db (SQLite).

No attachment parts in the session DB

All message parts in the session have types: text, tool, reasoning, step-start, step-finish. Count of parts with type file, image, or attachment: 0.

SELECT DISTINCT json_extract(data,'$.type') FROM part;
-- text, step-start, reasoning, tool, step-finish
SELECT count(*) FROM part WHERE json_extract(data,'$.type') IN ('file','image','attachment');
-- 0
User message arrived as text only

The stored text part of the message about the attachment contains only plain text. No file content or file metadata is present anywhere in the part table.

Delivery pipeline is empty

Tables session_input and session_message (which track input being admitted, promoted, and delivered to the agent) are both empty.

No upload events in runtime log

/root/.local/share/opencode/log/2026-08-07T094708.log contains only permission evaluations for agent commands. No upload/attachment events were ever recorded.

Conclusion
This is not a workspace configuration problem and not an agent-side problem.
The runtime uses the Agent Client Protocol (OPENCODE_CLIENT=acp). The web UI connects to the agent through an ACP bridge.
The .txt file was attached in the browser, but its content was never serialized into the message delivered to the agent session. It was dropped between the chat UI and the ACP bridge.
From the platform's perspective the message was sent as text only, so the agent had nothing to act on.
Suggested fix location (for platform engineers)
Inspect the file-upload code path in the chat UI: verify the attachment is still present in the composer payload at send time.
Inspect the ACP message serialization: file/image parts must be converted into ACP file content parts. The part table in opencode records text/tool/reasoning/ step-start/step-finish but never file, which indicates the attachment never entered the session at all.
Workaround for the user
Paste the file content directly into the chat until the upload path is fixed.
Confirm a file chip is visible in the composer immediately before clicking send.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the chat UI file-upload path and composer payload at send time, then inspect the ACP bridge message serialization. Compare the delivered message with the session_input, session_message, and part records in /root/.local/share/opencode/opencode.db and the runtime log. Done means a .txt attachment is serialized as ACP file content and appears in the agent session.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.