Skip to content

fix(chat): omo에서 /new 후 이전 대화가 남아 보이는 문제 수정 - #351

Merged
devswha merged 5 commits into
devswha:mainfrom
WOULDU-pres:fix/chat-follow-new-session
Oct 2, 2026
Merged

devswha merged 5 commits into
devswha:mainfrom
WOULDU-pres:fix/chat-follow-new-session

Conversation

@WOULDU-pres

Copy link
Copy Markdown
Contributor

Change

안녕하세요. OmO pane에서 /new로 새 대화를 시작해도, 채팅 화면이 새 메시지를 입력하기 전까지 이전 대화를 계속 보여 주는 문제를 확인하여 수정을 제안드립니다.

터미널 보기에서 /new를 입력하면 OmO는 새 대화로 넘어가지만, 채팅 보기에는 방금까지의 대화가 그대로 남습니다. 새 메시지를 보내야 비로소 새 대화로 바뀌기 때문에, 그 사이에는 이미 끝난 대화를 현재 대화로 오해하기 쉽습니다. OmO pane에서 메시지를 한 번 주고받은 뒤 /new를 입력하고 채팅 보기를 열면 재현할 수 있습니다.

원인을 확인해 보니, OmO는 /new 직후 새 세션의 holder 기록(session-holders/<새 id>/<pid>.json)을 바로 남기지만, 세션 파일(*.jsonl)은 첫 메시지와 함께 만듭니다. 기존 코드는 holder가 가리키는 세션의 파일이 아직 없으면 그 정보를 건너뛰었습니다. 그 결과 "프로세스 시작 이후 만들어진 유일한 세션" 추론으로 넘어가, /new 이전의 파일을 선택하고 있었습니다.

이번 변경은 holder 정보를 runtime에 반영하는 부분을 heldRuntime으로 분리하고, 현재 잡고 있는 세션의 파일이 아직 없으면 그 세션 id만 근거로 남깁니다. 이렇게 하면 selectOmoTranscript가 이전 파일을 고르지 않습니다. 채팅은 OmO를 처음 실행했을 때와 같은 상태(대화 없음, 터미널 출력 fallback)를 보여 주고, 첫 메시지로 새 세션 파일이 생기면 그 대화를 따라갑니다.

  • 잡고 있는 세션의 파일이 있으면 기존과 동일하게 그 파일을 선택합니다(launch --session-id나 herdr의 세션 정보보다 우선).
  • holder 기록이 없는 경우(이전 버전 OmO 등)의 판단은 바꾸지 않습니다.
  • 같은 폴더의 다른 pane이 가진 세션을 판단하는 기존 규칙과 Codex·Claude 등 다른 에이전트 경로는 그대로 유지합니다.

server/omo.test.ts에 /new 직후(새 세션 파일 없음), launch --session-id가 남은 경우, 첫 메시지로 파일이 생긴 뒤, holder가 없는 경우를 검증하는 테스트를 추가했습니다. 변경 이력도 Unreleased 항목에 기재했습니다.

Validation

별도로 만든 테스트 세션과 임시 폴더(/tmp/omo-new-probe)에서 실제 OmO를 실행했습니다. 메시지 한 번 → /new 순서로 입력하고, 각 단계에서 /api/pane/conversation 응답과 실제 브라우저의 채팅 화면을 기록했습니다. 원본(47df814)과 수정본을 같은 스크립트로 각각 실행했습니다.

단계 수정 전: 47df814 수정 후
첫 메시지 후 omo-transcript, 1 turn omo-transcript, 1 turn
/new 직후(입력 없음) omo-transcript, 1 turn(이전 대화) scrollback, 0 turn(새로 시작한 OmO와 동일)
채팅 화면의 이전 메시지 계속 표시 표시되지 않음

수정 전 캡처 (/new 직후)

수정 전: /new 후에도 이전 대화가 남아 있음

수정 후 캡처 (/new 직후)

수정 후: /new 후 이전 대화가 사라짐

캡처는 이번 검증용으로 생성한 테스트 세션에서 촬영했습니다. 운영 중인 터미널이나 사용자 대화는 포함하지 않았으며, 이미지와 재현 스크립트, 단계별 기록(수정 전, 수정 후)은 포크의 별도 자료 브랜치에 보관했습니다.

검증 환경: Linux(WSL), Herdr 0.9.3, OmO 5.1.10, Bun 1.4.2, lockfile에 맞는 Playwright Chromium 153.

  • bun run typecheck: 통과
  • bun run build: 통과
  • bun run test:unit: 1,037건 통과, 3건 건너뜀, 실패 없음
  • server/omo.contract.test.ts, server/omo-prompt.contract.test.ts: 8건 통과, 실패 없음
== after /new, nothing typed
수정 전 api: omo-transcript turns=1 text="Reply with exactly: probe-ok-1"
수정 후 api: scrollback turns=0 text=""

/new 이후 첫 메시지로 새 세션 파일이 생기면 그 대화를 따라가는 동작은 단위 테스트로 확인했습니다. 실제 OmO로는 /new 직후 단계까지만 기록했습니다.

확인해 주시면 감사하겠습니다. /new 직후 채팅에 보여 줄 상태(현재는 OmO를 처음 실행했을 때와 같은 fallback)에 선호하시는 방향이 있으면 그에 맞춰 조정하겠습니다.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d5adf8a9-311a-4e8c-9e42-ea24159a8a96

📥 Commits

Reviewing files that changed from the base of the PR and between 481a5af and fed69bd.

📒 Files selected for processing (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Starting a new OmO session no longer displays the previous conversation while the new session file is being created. The new conversation appears after the first message is sent.

Walkthrough

omoTranscriptsOfCwd reconciles runtimes with held session IDs before selecting transcripts. After /new, an unwritten session no longer leaves the previous conversation selected.

Changes

OmO transcript selection

Layer / File(s) Summary
Held runtime reconciliation
server/omo.ts, server/omo.test.ts, CHANGELOG.md
heldRuntime clears stale paths when held session IDs have no matching candidate file. Transcript selection uses the reconciled runtime. Tests cover an unwritten session, its file appearing, and no held sessions. The changelog describes the /new behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to fed69

The reviewed /new path no longer displays the previous conversation while the new session file is absent. No actionable merge-blocking issue remains after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 54859

The change affects 2 systems.

Changed systems: server, CHANGELOG.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — server (service) was modified; 2 changed files map to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Added an Unreleased Fixed entry stating that after /new in an OmO pane, the chat no longer shows the prior conversation while OmO has not yet written the new session file; it shows the new conversation once it begins.
  • observed — Modified behavior in server/omo.test.ts: The test imports heldRuntime from ./omo.ts.
  • observed — Modified behavior in server/omo.test.ts: Adds tests showing that after /new, a newly held session with no file yields no transcript, even when the runtime also lists an earlier session. Once the new session's file exists, it is selected; holding no sessions leaves the runtime unchanged.
  • observed — Modified behavior in server/omo.ts: Added exported heldRuntime. It leaves a runtime unchanged when no session IDs are held; otherwise, it uses paths for candidate files whose IDs are held and clears the runtime’s IDs, or, if none match, clears its paths and sets its IDs to the held IDs. Previously, no helper handled the unmatched-held-ID case.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing the previous conversation remaining visible after /new in an OmO chat.
Description check ✅ Passed The description includes both required sections, explains the problem and resulting behavior, documents the implementation, and lists validation results with UI screenshots and relevant test coverage.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 u…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit 6a94148 into devswha:main Oct 2, 2026
12 checks passed
devswha added a commit that referenced this pull request Oct 3, 2026
Bumps package.json and herdr-plugin.toml to 0.3.44, moves the Unreleased
notes under [0.3.44] - 2026-10-03, adds the compare link, and removes a
merge marker line left in CHANGELOG.md by #351's conflict resolution.
### Added
- Native Windows x64 installation through `install.ps1`, with the same
herdr plugin startup
and updates. Windows needs Bun and Git, without Node or WSL, and keeps
using the terminal
screen mirror. ([#330](#330)
by @JJLiebig)
- Settings can choose Chat, Terminal, or Auto as the default view for
panes. Changing it resets
remembered pane views on this device. Shell panes still open in
Terminal.
([#325](#325) by
@Haeminway1)
- Choose the terminal input line or direct typing on desktop as well as
touch screens, and
customize or unbind the app's Mod+Shift shortcuts with conflict checks
and reset.
  ([#334](#334))

### Changed
- In the sidebar's By workspace view, a workspace with one pane keeps
its numbered header and
can be folded, renamed and reordered from that header, just like a
workspace with several panes.
  ([#332](#332) by @beomq)
- The top usage panel shows larger percentages, remaining-capacity
colors and compact reset
countdowns with their local time. Expired reset times stay hidden until
fresh usage arrives.
([#336](#336) by
@Haeminway1)
- Pane titles that contain a directory show its last folder, and
matching workspace and folder
names appear once in the sidebar and command palette, including Windows
paths.
([#337](#337) by
@Haeminway1)
- In the sidebar's By workspace view, a pane row no longer repeats the
workspace its header names.
Its second line shows the folder only when neither the title nor the
workspace already says it.
  ([#358](#358))

### Fixed
- GJC conversations are resolved from the foreground process directory
when it differs from
the pane directory.
([#333](#333) by @Kinetic27)
- Direct terminal input preserves rapid IME commits when punctuation
arrives before composition
timers run, with a bounded xterm 5.5 backport and Korean final-consonant
regression checks.
Native Android/Gboard checks also fixed stale editor text after
Backspace breaking the next
Hangul word. Secret entry now refuses a held or unready attachment and
failed PTY writes.
  ([#334](#334))
- New session in the browser demo opens the new session instead of
leaving a blank page.
  ([#355](#355))
- Terminal input keeps multi-character IME commits and emoji while
disconnected, waits for the
attachment before sending keys, and reports input failures. Unsent input
lines survive pane,
lens and mode changes; late acknowledgements preserve replacement edits.
Composition keeps
its Enter and Send button, and terminal key-bar taps wait until it
finishes.
  ([#334](#334))
- The background tasks list stays below the app header on a short
screen, such as a phone held
  sideways, and scrolls inside the room above the message box.
  ([#354](#354))
- The mobile message box sits closer to the home indicator while
retaining its base spacing.
([#335](#335) by
@Haeminway1)
- Adding or reconnecting a remote PC says when herdr is not running or
not answering there,
  instead of only `Bridge verification failed (500)`.
  ([#353](#353))
- Shift+Enter in the live terminal sends the same newline chord as
Alt+Enter, instead of plain
Enter that submits an agent's message. Pending IME text is sent before
the newline chord.
([#339](#339) by
@WOULDU-pres)
- On Windows, and from an install path with a space or a non-ASCII
character, the app page loads
instead of the "not built yet" notice. The Windows installer replaces a
copy from a release
  without Windows support, and says so when a release cannot run there.
  ([#356](#356))
- On an iPhone home screen app, a text field that keeps its focus with
the keyboard down no
  longer leaves a status-bar band under the message box.
([#349](#349) by
@Haeminway1)
- After `/new` in an OmO pane, the chat stops showing the conversation
before it: OmO writes the
new session's file only with its first message, and until then the chat
shows what a fresh OmO
shows. ([#351](#351) by
@WOULDU-pres)
- On a Windows PC, an omo pane shows omo's mark instead of Claude's, and
its chat finds the
conversation: process words with `bun.exe`, backslashes and a drive
letter read as omo, and the
  session folder is named as omo's engine names a Windows folder.
([#342](#342) by
@Haeminway1)
- The chat lens finds an omo pane's conversation when its process keeps
its sessions outside
`~/.omo/agent` (`OMO_CODING_AGENT_DIR`, `SENPI_CODING_AGENT_DIR` or
`PI_CODING_AGENT_DIR`).
([#350](#350) by
@Haeminway1) passes. After the merge: .
devswha added a commit that referenced this pull request Oct 3, 2026
## Change

An OmO pane that has not been sent a message yet opens its chat on
"Conversation unavailable — show terminal output". That happens on every
new OmO pane and after every `/new`, so a working pane looks broken
until the first message.

OmO publishes its holder record (`session-holders/<id>/<pid>.json`) as
soon as it starts or runs `/new`. It writes the session file (`*.jsonl`)
only with the first message. In the session that found this, the holder
appeared at 15:45:41 and the file at 15:46:12, when the first message
was sent. During that gap no file names the held session, so
`/api/pane/conversation` answered `scrollback` and the chat showed the
terminal fallback.

#351 already stops the chat from showing the conversation from before
`/new`. It left this state as the fresh-OmO fallback and asked which
state the chat should show. This PR proposes an answer: an empty OmO
chat.

- `server/omo.ts`: when the one session a pane's OmO process holds has
no file in the store yet, `omoSessionForPane` reports it as `pending`.
It builds on #351's `heldRuntime`. The check reads the store's file
names directly, so the bounded candidate list cannot mistake an existing
file for a missing one. `omoTranscriptForPane` keeps its signature.
- `server/conversation.ts`: for such a pane, `paneConversation` returns
an empty `omo-transcript` (`turns: []`, `cursor: null`, `history_id:
"unwritten:<session id>"`) instead of throwing
`ConversationUnavailable`. The chat then shows its existing "No
conversation yet — say something below" state. The first message writes
the file, the `history_id` changes, and the chat loads that
conversation. Image and tool-output lookups still treat the pane as
having no transcript.
- `CHANGELOG.md`: entry under `[Unreleased]` → `### Fixed`.

## Validation

macOS (Apple silicon), herdr 0.9.3, Bun 1.4.2, omo-ai with the senpi
engine.

- **Real OmO, no message sent:** ran OmO in an owned, temporary
workspace and queried both servers before any message.
  - Release v0.3.43: `{"source":"scrollback","turns":[]}`
- This branch:
`{"source":"omo-transcript","turns":[],"metadata":{"model":null,"reasoning_effort":null},"cursor":null,"history_id":"unwritten:01a0fe94-…"}`
- An existing OmO pane whose session was already written read the same
on this branch.
- **Screenshots:** same pane, English UI, sidebar cropped out.

  | Before (v0.3.43) | After |
  | --- | --- |
|
![before](https://raw.githubusercontent.com/nahwan-kim/herdr-web-ui/fix/omo-unwritten-session/docs/screenshots/omo-new-session/before.png)
|
![after](https://raw.githubusercontent.com/nahwan-kim/herdr-web-ui/fix/omo-unwritten-session/docs/screenshots/omo-new-session/after.png)
|

- **Contract tests** in `server/omo.contract.test.ts`:
- `tells a held session omo has not written yet from an older one`: a
fresh pane, a pane whose launch `--session-id` names an older session
(as after `/new`), a file whose name only contains the held id, and the
pane resolving to its file once it is written.
- `serves a held omo session as an empty conversation until its file is
written`: over HTTP (`createServer`), the empty `omo-transcript` with
`history_id: "unwritten:<id>"`, 409 for a stale `before` cursor, then
the written transcript with a new `history_id`.
- Both pass. Each fails when its check is reverted (`pending` disabled,
the old `includes` name match, the `before` 409 removed).
- `bun run generate:types --check`, `bun run typecheck`, `bun run
build`: pass.
- `bun run test:unit`: 1057 passed, 4 skipped, 1 failed. The failure is
`server/pi.test.ts` "accepts a session file inside the store", which
also fails on `upstream/main` on macOS (`/var` vs `/private/var`
tmpdir).
- `server/omo.contract.test.ts` on macOS, run with `TMPDIR=$(realpath
$TMPDIR)`: 6 passed. Two tests fail the same way on `upstream/main`
because they read `/proc`.

### Not verified

- **First message with real OmO:** the switch from the empty chat to the
real conversation after the first message was not run end to end, since
it needs a model call. The contract test covers the file selection, and
the `history_id` change uses the chat's existing reset path.
- **Screenshot base:** the screenshots and the real-OmO check ran before
this branch was rebased onto #351, #342 and #350 (per-process agent
directories). The checks above were rerun on the rebased branch.
- **Linux and Windows:** not run.

---------

Co-authored-by: Hako <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants