feat(plugin): OpenCode Companion beta.8 upgrade + streaming/overflow (#337)

* feat(plugin): OpenCode Companion beta.8 upgrade + streaming/overflow
fixes

Upgrade to plugin API 21 and reverse the chat so the newest message sits
at the bottom with auto-scroll:

- panel: reverse message list to oldest-first; pin the scroll to the
  bottom via stickToBottom, jump there on open and session switch via
  scrollToBottomRev, and clear the stick flag in onScroll when the user
  scrolls away so reading history doesn't yank them down.
- composer: enable submitOnEnter so Enter sends and Shift+Enter inserts
  a
  newline; update en/vi placeholder and send-tooltip strings.
- panel: render assistant replies as markdown (headings, lists, tables),
  keeping user messages as plain labels.

Fix runtime errors surfaced during use:

- panel: pin markdown width to WRAP — ui.markdown has no maxWidth prop,
  so
  a bare flexGrow left it unconstrained and single-line text overflowed.
- panel: wrap fenced code blocks in monospace labels with a maxWidth —
  noctalia's MarkdownView never wraps code, so long bash/code lines
  spilled outside the panel. Text outside code fences stays markdown.
- panel: coerce onScroll(offset, maxOffset) args with tonumber — the
  reconciler passes them as strings, raising "attempt to compare number
  <= string".
- service: handle message.part.updated / message.updated streaming via
  throttled reload; acknowledge message.part.delta without reloading
  (the
  server emits one per token, and reloading on each decodes the whole
  history and blows the async callback CPU budget in json.decode).
- service: handle session.updated / session.diff with a throttled
  session
  reload so auto-generated titles stay current in the chooser.

Verified with luac syntax checks and a standalone split_markdown test
(5 cases) and JSON validation of the translation files.

* update version to 0.2.0
This commit is contained in:
weinguyen
2026-08-12 09:49:13 -04:00
committed by GitHub
parent 6fcf69f738
commit 27458632e2
6 changed files with 210 additions and 95 deletions
+14 -15
View File
@@ -89,21 +89,20 @@ noctalia msg plugin weinguyen/opencode-companion:service all create_session
## Settings
| Setting | Type | Default | Description |
| -------------------- | ------ | ------------- | --------------------------------------------------------------- |
| `server_mode` | string | `"auto"` | `"auto"` manages a local server; `"external"` connects to a URL |
| `server_host` | string | `"127.0.0.1"` | Hostname the managed server binds to (loopback only) |
| `server_port` | double | `4096` | Port the managed server listens on |
| `server_url` | string | `""` | External server URL (used in `"external"` mode) |
| `default_workspace` | folder | `""` | Default working directory for new sessions |
| `default_model` | string | `""` | Default model in `provider/model` format |
| `default_agent` | string | `"build"` | Default agent for new sessions |
| `auto_start` | bool | `true` | Auto-start the managed server |
| `show_tool_calls` | bool | `true` | Show tool call status cards |
| `show_reasoning` | bool | `false` | Show reasoning/thinking text |
| `notify_on_complete` | bool | `true` | Notify when a response completes |
| `max_messages_load` | double | `50` | Max messages to load per session |
| `debug_logging` | bool | `false` | Print debug messages |
| Setting | Type | Default | Description |
| ------------------- | ------ | ------------- | --------------------------------------------------------------- |
| `server_mode` | string | `"auto"` | `"auto"` manages a local server; `"external"` connects to a URL |
| `server_host` | string | `"127.0.0.1"` | Hostname the managed server binds to (loopback only) |
| `server_port` | double | `4096` | Port the managed server listens on |
| `server_url` | string | `""` | External server URL (used in `"external"` mode) |
| `default_workspace` | folder | `""` | Default working directory for new sessions |
| `default_model` | string | `""` | Default model in `provider/model` format |
| `default_agent` | string | `"build"` | Default agent for new sessions |
| `auto_start` | bool | `true` | Auto-start the managed server |
| `show_tool_calls` | bool | `true` | Show tool call status cards |
| `show_reasoning` | bool | `false` | Show reasoning/thinking text |
| `max_messages_load` | double | `50` | Max messages to load per session |
| `debug_logging` | bool | `false` | Print debug messages |
## Session Lifecycle