Skip to content

Commit f5641fe

Browse files
committed
feat: update readme and tests
1 parent eaab81e commit f5641fe

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ You can use AgentAPI:
5454

5555
Run an HTTP server that lets you control an agent. If you'd like to start an agent with additional arguments, pass the full agent command after the `--` flag.
5656

57+
> [!NOTE]
58+
> When using Codex, make sure to explicitly specify the agent type (for example, `agentapi server -- codex`) after the `--` flag when starting the server.
59+
5760
```bash
5861
agentapi server -- claude --allowedTools "Bash(git*) Edit Replace"
5962
```

lib/msgfmt/message_box.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func removeCodexMessageBox(msg string) string {
6464
} else {
6565
// We reached the start of the message box (we don't want to show this line), also exit the loop
6666
if strings.Contains(lines[i], "╭") && strings.Contains(lines[i], "───────╮") {
67+
// We only want this to be i + 1 in case the top of the box is visible
6768
messageBoxStartIdx = i + 1
6869
break
6970
}
@@ -80,7 +81,7 @@ func removeCodexMessageBox(msg string) string {
8081
}
8182

8283
if messageBoxEndIdx > messageBoxStartIdx {
83-
return strings.Join(lines[messageBoxStartIdx:max(0, messageBoxEndIdx)], "\n")
84+
return strings.Join(lines[messageBoxStartIdx:messageBoxEndIdx], "\n")
8485
}
8586

8687
return strings.Join(lines, "\n")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
command (code: 127, duration: 10ms)
2+
$ bash -lc 'rg -n "func formatCodexMessage"'
3+
bash: line 1: rg: command not found
4+
5+
command (code: 0, duration: 8.23s)
6+
$ bash -lc 'grep -R "formatCodexMessage" -n .'
7+
./lib/msgfmt/testdata/format/claude/multi-line-input/user.txt:3:func formatCodexMessage(message string, userInput string) string {
8+
./lib/msgfmt/msgfmt.go:219:func formatCodexMessage(message string, userInput string) string {
9+
./lib/msgfmt/msgfmt.go:236: return formatCodexMessage(message, userInput)
10+
11+
codex
12+
The formatCodexMessage function is defined in:
13+
14+
lib/msgfmt/msgfmt.go (around line 219)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
│command (code: 127, duration: 10ms) │
2+
│$ bash -lc 'rg -n "func formatCodexMessage"' │
3+
│bash: line 1: rg: command not found │
4+
│ │
5+
│command (code: 0, duration: 8.23s) │
6+
│$ bash -lc 'grep -R "formatCodexMessage" -n .' │
7+
│./lib/msgfmt/testdata/format/claude/multi-line-input/user.txt:3:func formatCodexMessage(message string, userInput string) string { │
8+
│./lib/msgfmt/msgfmt.go:219:func formatCodexMessage(message string, userInput string) string { │
9+
│./lib/msgfmt/msgfmt.go:236: return formatCodexMessage(message, userInput) │
10+
│ │
11+
│codex │
12+
│The formatCodexMessage function is defined in: │
13+
│ │
14+
│lib/msgfmt/msgfmt.go (around line 219) │
15+
│ │
16+
│ │
17+
│ │
18+
│ │
19+
│ │
20+
│ │
21+
│ │
22+
│ │
23+
│ │
24+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
25+
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
26+
│ send a message — 97% context left │
27+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────Enter to send | Ctrl+D to quit | Ctrl+J for newline╯
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Which file is this function from?
2+
```go
3+
func formatCodexMessage(message string, userInput string) string {}
4+
```

0 commit comments

Comments
 (0)