Skip to content

Commit 3c2b74c

Browse files
committed
docs(forklog): record markdown in user messages and message blocks
Feature record and session record for syntax.user_messages, syntax.blocks and api.blocks.register: the Vibeterm route plugin rule (opencode-tools 0497c41), upstream issues anomalyco#55439/anomalyco#55440 and PRs anomalyco#55441/anomalyco#55442 against v1, vt-292 on desktop and m4max with the gate passed, and the knob enforced through Vibeterm settings on both hosts. The tool syntax coloring timeline notes the palette slots and toolInputColors this shares. AI-Tool: opencode 1.19.0-vt-285-dfb56f76c7 AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Platform: linux AI-Harness: Vibeterm 1e793a4-dirty AI-Session-ID: ses_ec57be11affe3kxXJ4WyM3OwOY
1 parent b99d95a commit 3c2b74c

4 files changed

Lines changed: 220 additions & 0 deletions

File tree

‎.vibeterm/forklog/README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,16 @@ carries every feature forward unchanged. That commit includes the full
101101
- [Prompt start height, percentage sizes and home screen layout](./features/2026-10-12-home-screen-layout.md)
102102
- [Deliver and settle TUI worker requests without startup races](./features/2026-10-12-tui-worker-error-reply.md)
103103
- [tui.json decides over remembered runtime toggles](./features/2026-10-12-tui-config-toggle-precedence.md)
104+
- [Markdown in submitted user messages and plugin-defined message blocks](./features/2026-10-14-user-message-markdown.md)
104105

105106
## Session records
106107

108+
- [2026-10-14 `ses_ec57be11affe3kxXJ4WyM3OwOY`](./sessions/2026-10-14-user-message-markdown.md)
109+
- `syntax.user_messages` colors markdown in submitted messages; `syntax.blocks`
110+
and `api.blocks.register` draw delimited blocks, `[vibeterm_*]` as YAML via
111+
the route plugin; issues #55439/#55440, PRs #55441/#55442; vt-292 on both
112+
hosts, enforced on both.
113+
107114
- [2026-10-14 `ses_eebf9a83fffeIQQwW9gVFo5jaO`](./sessions/2026-10-14-instant-drag-copy.md)
108115
- A drag anywhere on opencode's instant home and "Loading session…" screens
109116
copies the drawn text (OSC 52 plus native clipboard), not only inside the

‎.vibeterm/forklog/features/2026-10-11-tool-syntax-coloring.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ Reported by `ses_ed1e2b932ffe6tTqhsOiGuYXRE`; see its
113113
user question "support for systemd units coloring?": heredoc bodies written to
114114
unit files were a shell string; now ini. PRs #54705 and #54706 amended.
115115
Evidence: `246c6c10f2`; two-heredoc frames at 40/80/160; PTY at 80/160.
116+
- 2026-10-14 [`ses_ec57be11affe3kxXJ4WyM3OwOY`](../sessions/2026-10-14-user-message-markdown.md) -
117+
`toolCodeTheme` gains the markdown slots for colored user messages, and the
118+
tool input block's colors become `toolInputColors`, shared with YAML message
119+
blocks. See [markdown in user messages](./2026-10-14-user-message-markdown.md).
120+
Evidence: `5e5994b93a`, `748601cc2b`; `tool-code-theme.test.ts`.
116121

117122
## Future ideas
118123

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Markdown in submitted user messages and plugin-defined message blocks
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `message-syntax` (worktree off `dev-nowaker`);
8+
upstream branches `message-markdown` (`9de106cb26`, stacked on
9+
`tool-output-syntax`) and `message-blocks` (`2c659ccfe6`, stacked on
10+
`message-markdown`), off `github/v1` `dfb56f76c7`
11+
- First local commit: `5e5994b93a`
12+
- Current local commit(s): `5e5994b93a`, `748601cc2b`
13+
- Upstream base when introduced: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
14+
- Last checked against upstream: `dfb56f76c7`
15+
- Upstream: issues [#55439](https://github.com/anomalyco/opencode/issues/55439),
16+
[#55440](https://github.com/anomalyco/opencode/issues/55440); PRs
17+
[#55441](https://github.com/anomalyco/opencode/pull/55441) (markdown, stacked
18+
on #54968) and [#55442](https://github.com/anomalyco/opencode/pull/55442)
19+
(blocks, stacked on #55441), both against `v1`. **Needs a v2 port later.**
20+
21+
## Original request
22+
23+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 37), the user
24+
verbatim:
25+
26+
> i want syntax coloring of user already submitted messafges. it doesn't (and
27+
> can't) be as good as ai messages because we humans type botched syntax, but we
28+
> can probably fire opencode's md colorizer at it, to colorize: 1. ble 2. blah
29+
> (or - bullet points) wherever they show up. or colorize `content in ticks`. or
30+
> colorize #headers of various level. maybe even try tables?
31+
> and for vibeterm specicially needed real bad, and to be proposed as separate PR
32+
> with hopes they wil accept, we'd like to define custom formatters, or whatever
33+
> to call it (if not possible today, who knows?) - speciafaclly, i need us to
34+
> catch any
35+
> [vibterm_*]
36+
> ...
37+
> [/vibeterm_*]
38+
> and render it with our standard yaml colors/formatting.
39+
40+
## Goals
41+
42+
- `syntax.user_messages` (default `false`, as upstream) colors the markdown in a
43+
submitted user message: headings, lists, inline and fenced code, emphasis,
44+
links, quotes, tables.
45+
- Only colors change: text as typed, wraps as plain, nothing concealed, no red.
46+
- Accidental markdown stays plain: setext headings, indented code, lazy quote
47+
continuation, intra-word emphasis.
48+
- A plugin (`api.blocks.register`) or `syntax.blocks` defines a delimited block
49+
and its format; `yaml` uses the tool input block's colors.
50+
- Vibeterm's `[vibeterm_*]` blocks draw as YAML through the `vibeterm.route`
51+
plugin, with no tui.json entry.
52+
53+
## Non-goals
54+
55+
- Assistant text: it goes through `<markdown>`, which has no per-range hook.
56+
- Rendering markdown (concealment, reflow) in user messages.
57+
58+
## Rationale and constraints
59+
60+
- The tree-sitter markdown grammar already in opentui gives highlights on the
61+
raw text; setting them as chunks on one text renderable (`StyledOutput`, from
62+
#54968) keeps layout identical, where `<markdown>` would reflow and conceal.
63+
- Upstream PR B does not depend on #54707: it keeps its own `YamlKind` and
64+
`yamlColors`; the fork shares one `toolInputColors` between the tool input
65+
block and YAML blocks.
66+
67+
## Changes
68+
69+
| Commit | Workday | Change | Stable seam |
70+
|---|---|---|---|
71+
| `5e5994b93a` | 2026-10-14 | `syntax.user_messages`; forgiving markdown highlights over user text; markdown slots in the non-red palette | `UserText` in `routes/session/index.tsx`; `util/user-markdown.ts` `forgivingMarkdown`; `ALTERNATIVES` in `theme/tool-code.ts`; `Syntax` in `config/index.tsx` |
72+
| `748601cc2b` | 2026-10-14 | `syntax.blocks`, `api.blocks.register`, yaml formatter; `toolInputColors` shared with `GenericTool` | `util/message-blocks.ts` `messageSegments`, `yamlSegments`; `messageChunks` in `routes/session/index.tsx`; `TuiMessageBlock` in `packages/plugin/src/tui.ts`; `registerBlock` in `plugin/runtime.tsx`; `blocks` in `opencode/src/plugin/tui/runtime.ts` |
73+
74+
opencode-tools `0497c41`: `opencode-vibeterm-route-plugin/message-blocks.ts`
75+
registers `[vibeterm_*]` / `[/vibeterm_*]` / `yaml`.
76+
77+
Docs: `user_messages` and `blocks` under `Syntax highlighting` in
78+
`packages/web/src/content/docs/tui.mdx`.
79+
80+
## Verification
81+
82+
Reported by `ses_ec57be11affe3kxXJ4WyM3OwOY`; see its
83+
[session record](../sessions/2026-10-14-user-message-markdown.md).
84+
85+
## Timeline
86+
87+
- 2026-10-14 [`ses_ec57be11affe3kxXJ4WyM3OwOY`](../sessions/2026-10-14-user-message-markdown.md) -
88+
initial build of both parts, Vibeterm route plugin rule, upstream issues and
89+
PRs, install on both hosts, `syntax.user_messages` enforced on both hosts.
90+
Evidence: `5e5994b93a`, `748601cc2b`; PTY at 80/160.
91+
92+
## Current maintenance notes
93+
94+
- The upstream branches carry no AI trailers; the fork commits do.
95+
- Fork vs upstream B: `toolInputColors` + `ToolInputKind` (fork, from #54707)
96+
vs `yamlColors` + `YamlKind` (upstream). Whichever of #54707 and #55442 lands
97+
second merges them.
98+
- `syntax.blocks` is an array of objects, so the opencode-tools knob catalog
99+
does not list it; `syntax.user_messages` is a global-only knob there
100+
(opencode-tools `a42e4c6`).
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Markdown in user messages and [vibeterm_*] blocks as YAML
2+
3+
## Identity
4+
5+
- Workday: 2026-10-14
6+
- Session: `ses_ec57be11affe3kxXJ4WyM3OwOY`
7+
- Agent/platform: Sisyphus (anthropic/claude-opus-5-5, high) / linux
8+
- Repository: `~/projekty/webapps/opencode`; opencode-tools
9+
- Integration branch: `dev-nowaker`
10+
- Development branch(es): `message-syntax`; upstream `message-markdown`,
11+
`message-blocks`
12+
- Upstream base: `dfb56f76c7` (`v1.19.0`)
13+
- Source result commit(s): `5e5994b93a`, `748601cc2b`
14+
- Forklog commit: this file's introducing commit
15+
16+
## User requests
17+
18+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 37); the
19+
verbatim request is in the
20+
[feature record](../features/2026-10-14-user-message-markdown.md#original-request).
21+
The coordinator added: knob default off as upstream, the user's value only
22+
through Vibeterm settings, prefer extending the TUI plugin API over hardcoding
23+
Vibeterm, a real-terminal check, both-host install, upstream PRs against v1.
24+
25+
## Goals
26+
27+
- Color the markdown in submitted user messages without changing their text or
28+
wrap.
29+
- Let a plugin or config format a delimited block; draw `[vibeterm_*]` as YAML.
30+
31+
## Constraints and non-goals
32+
33+
- Never red in the transcript; no change to assistant text.
34+
- No restart of `opencode-serve-tailscale`, `opencode-serve-lan` or any tab.
35+
36+
## Branch and upstream movement
37+
38+
| Repository | Branch | Before | After | Action |
39+
|---|---|---|---|---|
40+
| opencode | `dev-nowaker` | `b0ebca176f` | `748601cc2b` | fast-forward of `message-syntax`, pushed to `origin` and `nowaker-github` |
41+
| opencode | `message-markdown` | - | `9de106cb26` | new, on `tool-output-syntax` (#54968), PR #55441 |
42+
| opencode | `message-blocks` | - | `2c659ccfe6` | new, on `message-markdown`, PR #55442 |
43+
| opencode-tools | `master` | `7e47b93` | `0497c41` | route plugin registers the `[vibeterm_*]` rule |
44+
45+
`ses_ec549ca11ffeaEknagLhxmfpFp` rebased its unpushed forklog commit
46+
`340c1ca1d8` onto `748601cc2b` as `181722b19d` after a queued note from this
47+
session; nothing of theirs was touched here.
48+
49+
## Features touched
50+
51+
| Feature | Outcome | Evidence |
52+
|---|---|---|
53+
| [Markdown in user messages and message blocks](../features/2026-10-14-user-message-markdown.md) | new | below |
54+
| [Syntax coloring in tool calls](../features/2026-10-11-tool-syntax-coloring.md) | changed | `toolCodeTheme` gains markdown slots; `GenericTool` reads `toolInputColors`; `tool-code-theme.test.ts` covers the new slots |
55+
56+
## Other delivered work
57+
58+
- opencode-tools `0497c41`: `registerMessageBlocks` in
59+
`opencode-vibeterm-route-plugin`, test, FEATURES.md.
60+
- `opencodeTui.syntax.user_messages` enforced `true` through `writeSetting` on
61+
desktop and m4max, after opencode-tools `a42e4c6`
62+
(`ses_ed1e2b932ffe6tTqhsOiGuYXRE`) gave the knob a Focus decision; the first
63+
attempt wrote tui.json but failed on `opencodeTui.enforced`.
64+
65+
## Verification
66+
67+
- packages/tui on `message-syntax` rebased on `b0ebca176f`: typecheck clean;
68+
full suite 681 pass, 0 fail. packages/plugin and packages/opencode typecheck
69+
clean; push hook 30/30 typecheck tasks.
70+
- Upstream `message-blocks`: tui, plugin and opencode typecheck clean; tui
71+
suite 247 pass, 0 fail.
72+
- Real PTY, scratch build `1.19.0-vt-289`, isolated XDG home, fake provider,
73+
throwaway `ocrig-*` tmux sockets, 80 and 160 columns, three variants (off;
74+
`syntax.blocks` in tui.json; the rule from the route plugin): the message's
75+
screen text is identical in all three; headings, list markers, inline code
76+
and table headers colored; YAML keys peach, strings green, numbers orange,
77+
booleans purple, delimiter lines grey; `done`/`---` plain; no red cell.
78+
- A first PTY attempt deadlocked: `Bun.spawnSync` of `opencode run` blocked the
79+
in-process fake provider. A second seeded the message with `opencode run`'s
80+
argument quoting (`"[vibeterm_metadata]`, `run.ts:289`), correctly unmatched;
81+
the final run seeds through stdin.
82+
83+
## Build and install
84+
85+
- Build command: `VIBETERM_V2_GUARD=<opencode-tools>/vibeterm-opencode-client/bin/vibeterm-v2-guard .vibeterm/build.sh`
86+
in each host's primary checkout at `181722b19d`
87+
- Installed artifact: `1.19.0-vt-292-dfb56f76c7`; desktop inode `49964691`,
88+
m4max inode `34213364`; v2 guard gate PASSED on both; retry marker present on
89+
both.
90+
- Running services: desktop `opencode-serve-tailscale` PID `914944` (started
91+
04:38:28 CDT) and `opencode-serve-lan` PID `910216` unchanged; no tab
92+
restarted, so running tabs pick this up on their next start.
93+
94+
## Commit provenance
95+
96+
- `5e5994b93a`, `748601cc2b` - source.
97+
- Required trailer: `AI-Session-ID: ses_ec57be11affe3kxXJ4WyM3OwOY`
98+
99+
```sh
100+
git log --format='%H %(trailers:key=AI-Session-ID,valueonly)' -- \
101+
.vibeterm/forklog/sessions/2026-10-14-user-message-markdown.md
102+
```
103+
104+
## Unknowns and blocked verification
105+
106+
- No v1/v2 patch-rig scenario added; not in the matrix.
107+
- The instant-editor test timed out once at load average ~80 on both this
108+
branch and the untouched base; it passed in the later full run.

0 commit comments

Comments
 (0)