Skip to content

Commit b16ce81

Browse files
authored
fix(opencode): update msgfmt for latest version (#148)
1 parent 92eacef commit b16ce81

File tree

11 files changed

+84
-3620
lines changed

11 files changed

+84
-3620
lines changed

lib/msgfmt/message_box.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ func removeCodexInputBox(msg string) string {
6363

6464
func removeOpencodeMessageBox(msg string) string {
6565
lines := strings.Split(msg, "\n")
66-
// Check the last 3 lines for
6766
//
68-
// ┃ ┃
69-
// ┃ > ┃
70-
// ┃ ┃
71-
// We only check for the first ┃ and then an empty line above it - as sometimes the full input block does not load within a snapshot,
72-
// this leads to displaying a bunch of newlines.
73-
for i := len(lines) - 1; i >= 2; i-- {
74-
if strings.ReplaceAll(lines[i-2], " ", "") != "┃┃" &&
75-
strings.ReplaceAll(lines[i], " ", "") == "┃┃" {
76-
lines = lines[:i-1]
67+
// ┃
68+
// ┃
69+
// ┃
70+
// ┃ Build Anthropic Claude Sonnet 4
71+
// ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
72+
// tab switch agent ctrl+p commands
73+
//
74+
for i := len(lines) - 1; i >= 4; i-- {
75+
if strings.HasPrefix(strings.TrimSpace(lines[i]), "╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀") {
76+
lines = lines[:i-4]
7777
break
7878
}
7979
}
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
█▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀
2-
█░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀
3-
▀▀▀▀ █▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀
4-
v0.6.8
1+
2+
█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
3+
█░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
4+
▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀
5+
1.0.98
56

6-
/new new session ctrl+x n
7-
/help show help ctrl+x h
8-
/share share session ctrl+x s
9-
/models list models ctrl+x m
10-
11-
12-
Grok Code is free for a limited time
7+
Commands ctrl+p
8+
List sessions ctrl+x l
9+
Switch model ctrl+x m
10+
Switch agent tab

lib/msgfmt/testdata/format/opencode/first_message/msg.txt

Lines changed: 22 additions & 601 deletions
Large diffs are not rendered by default.

lib/msgfmt/testdata/format/opencode/partial_render/expected.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/msgfmt/testdata/format/opencode/partial_render/msg.txt

Lines changed: 0 additions & 604 deletions
This file was deleted.

lib/msgfmt/testdata/format/opencode/partial_render/user.txt

Whitespace-only changes.
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
2-
┃ Shell Check git remote URLs to identify repository
3-
4-
┃ $ git remote -v
5-
┃ origin https://github.com/35C4n0r/agentapi (fetch)
6-
┃ origin https://github.com/35C4n0r/agentapi (push)
7-
┃ upstream https://github.com/coder/agentapi.git (fetch)
8-
┃ upstream https://github.com/coder/agentapi.git (push)
9-
10-
11-
12-
This is the 35C4n0r/agentapi repository, which is a fork of
13-
coder/agentapi.
14-
Build claude-sonnet-4-20250514 (09:19 PM)
1+
This is the agentapi repository. Based on the codebase structure and documentation, it's a Go HTTP API server that controls various coding agents (like Claude Code, Aider, Goose, etc.) through
2+
terminal emulation.
3+
4+
The main purpose of this repository is to:
5+
6+
- Run coding agents in an in-memory terminal emulator
7+
- Provide a unified HTTP API to interact with different agent types
8+
- Parse terminal output into structured messages
9+
- Include a Next.js web chat UI for interacting with agents
10+
- Support multiple agent types with different message formats
11+
12+
The project supports agents like Claude Code, Aider, Goose, Codex, Gemini, and others, providing a standardized interface to communicate with them through HTTP endpoints and a web-based chat
13+
interface.
14+
15+
Build claude-sonnet-4-20250514

0 commit comments

Comments
 (0)