Skip to content

fix(tui): show browser tool calls in the person's language - #260

Merged
its-janghoon merged 2 commits into
developfrom
fix/browserko
Nov 13, 2026
Merged

its-janghoon merged 2 commits into
developfrom
fix/browserko

Conversation

@its-janghoon

Copy link
Copy Markdown
Member

What's done

Follow-up to #257 ('한국어는?'). A browser tool call's row in the TUI now follows the TUI's language. Before, the generic row showed the raw browser open https://… in a Korean session too.

  • New Browser row (icon ◎), drawn by browserLabel() in packages/tui/src/util/tool-display.ts through the dictionaries:
    • en: Browser open https://example.com (in your Chrome), (in the built-in browser); pending Using the browser...
    • ko: 브라우저 열기 https://example.com (내 크롬에서), (내장 브라우저에서); pending 브라우저를 쓰는 중...
    • actions: 열기, 읽기, 클릭, 입력, 스크롤, 기다리기, 스크린샷
  • The engine puts the browser kind in metadata.browser: "chrome" | "own". It was "extension" | "chromium", and nothing read it. The plain title stays for non-TUI clients.

What's not done

  • redrob desk status (and the redrob run lines) stay English. The CLI has no Korean string or locale helper anywhere (packages/redrob/src/cli has no Hangul), so per the instruction no new CLI i18n system was added.
  • The model-facing first line (Browser: …) stays English on purpose.
  • The Chrome pairing prompt is the extension's own Korean text ({name}에서 이 브라우저를 쓰려고 해요); the device name Redrob Code on <host> is kept as a product name.

What to review

  • The Korean wording of the row, and whether (내 크롬에서) reads well after the URL.

Intentions

  • Same pattern as the WebFetch and WebSearch rows. No new i18n machinery.

Checks

  • test/util/tool-display.test.ts: 4 new tests (en and ko, chrome, own, no kind yet, every action has a Korean word). The 12 failures in test/i18n are the same 12 as on origin/develop (49 pass on develop, 53 here).
  • tsgo --noEmit in tui and redrob.
  • tmux on Linux, a real session, browser tool opening example.com:
    • ko: ◎ 브라우저 열기 https://example.com (내장 브라우저에서)
    • en: ◎ Browser open https://example.com (in the built-in browser) and ◎ Browser read https://example.com/ (in the built-in browser)
    • The Chrome label (내 크롬에서) / (in your Chrome) is covered by the unit test; Linux has no linked Chrome.

The browser tool's row in the TUI fell through to the generic row: the
raw tool name and its input in English, in a Korean session too. The
TUI now draws it through its dictionaries, from the input and the
browser kind the engine puts in the tool metadata:

- en: "Browser open https://example.com (in your Chrome)" /
  "(in the built-in browser)"
- ko: "브라우저 열기 https://example.com (내 크롬에서)" / "(내장 브라우저에서)"
- every action has its word (열기, 읽기, 클릭, 입력, 스크롤, 기다리기,
  스크린샷); while running: "브라우저를 쓰는 중..." / "Using the browser..."

The engine's metadata.browser is now "chrome" | "own" (was "extension" |
"chromium"; nothing read it). The plain title stays for other clients,
and the result line the model reads stays English.
@its-janghoon

Copy link
Copy Markdown
Member Author

Self-review.

  • Scope: TUI rendering only, plus renaming two metadata values that nothing read. The model-facing result and the plain title are unchanged, so redrob run and SDK clients see exactly what they did before.
  • The label comes from a pure function (browserLabel) taking the translator. The unit tests cover both languages without rendering. tmux runs in both languages showed the real row from a live session.
  • Risk: an older engine (v0.18.18) still sends browser: "extension" | "chromium". The new TUI then shows the row without the "(…)" kind instead of a wrong one. That only happens until the engine and TUI ship together in the next release.
  • Not done on purpose: CLI desk status stays English, because the CLI has no locale handling anywhere and inventing one was out of scope.

…l waits

While a browser call waits for Allow in the person's Chrome, the TUI
shows the code under the row, and it goes away on Allow, deny, expiry or
fallback:
- ko: "크롬에서 허용을 눌러 주세요 (코드 123456). 컴퓨터 알림과 레드롭 확장 옆 패널에 떠요."
- en: "Press Allow in Chrome (code 123456). It shows in a system notification and in the Redrob extension's side panel."
The tool polls the daemon link (GET /desk/status, or in process) while
its first request waits and streams the code as running metadata
(metadata.pairing).

When no Chrome with the extension is in the account, the first fallback
of a session says how to connect: a line in the result for the model to
pass on, and metadata.connect for the TUI:
- ko: "내 크롬을 쓰려면 크롬에 레드롭 확장을 설치하고, 확장 설정의 레드롭 챗에서 같은 레드롭 계정으로 연결해 주세요."
- en: "To use your own Chrome, install the Redrob extension in Chrome and connect it with the same Redrob account (extension Settings → Redrob chat → Connect)."

The link now expires a pairing request after the extension's ten
minutes on its own, even when desk.denied expired never arrives, and the
next call sends a fresh request with a new key and code. A later call
while the same request still waits waits 20 s (was 0), so the code shows
and an Allow is caught. A find request that did not reach the extension
no longer waits a second time.
@its-janghoon

Copy link
Copy Markdown
Member Author

Self-review of the second commit.

  • The notice polls the daemon's status once a second only while the first request of a call is waiting, and stops in a finally. A call that never pairs adds one status read.
  • The code comes from the same link state that redrob desk status prints, so the TUI can't show a code the extension didn't get.
  • Expiry no longer depends on the extension's desk.denied expired reaching us. Our relay peer id changes on every reconnect, and then that message never comes. The engine-side TTL matches the extension's 10 minutes.
  • Risk: the 20 s repeat wait means a model that calls the browser again right after a fallback waits 20 s. That only happens while a request is open, and it is what lets an Allow be caught.
  • The connect hint is per Code session and in-memory, so an engine restart may say it once more. That's acceptable.

@its-janghoon

Copy link
Copy Markdown
Member Author

What's done

Follow-up to #257 ('한국어는?'), and the Chrome link happening by itself while the person chats.

1. Browser rows in the TUI follow its language. A new Browser row (icon ◎), drawn by browserLabel() in packages/tui/src/util/tool-display.ts:

  • ko: 브라우저 열기 https://example.com (내 크롬에서) / (내장 브라우저에서); while running 브라우저를 쓰는 중...; actions 열기, 읽기, 클릭, 입력, 스크롤, 기다리기, 스크린샷
  • en: Browser open https://example.com (in your Chrome) / (in the built-in browser); Using the browser...
  • The engine puts the browser kind in metadata.browser: "chrome" | "own". It was "extension" | "chromium", and nothing read it. The plain title stays for non-TUI clients.

2. A live notice while the tool waits for Allow (browserNotice()). The notice shows under the row while the first request waits, and it goes away on Allow, deny, expiry or fallback:

  • ko: 크롬에서 허용을 눌러 주세요 (코드 123456). 컴퓨터 알림과 레드롭 확장 옆 패널에 떠요.
  • en: Press Allow in Chrome (code 123456). It shows in a system notification and in the Redrob extension's side panel.
  • How it works: UserBrowser.act polls the daemon link (GET /desk/status, or in process) every second while its request waits. The tool streams the code as running metadata (metadata.pairing), the same way shell streams its output.

3. How to connect, once per session, when no Chrome with the extension is in the account (metadata.connect):

  • ko: 내 크롬을 쓰려면 크롬에 레드롭 확장을 설치하고, 확장 설정의 레드롭 챗에서 같은 레드롭 계정으로 연결해 주세요.
  • en: To use your own Chrome, install the Redrob extension in Chrome and connect it with the same Redrob account (extension Settings → Redrob chat → Connect).
  • The result also gets one English line for the model to pass on in the person's language.

4. A fresh request by itself after expiry. The link expires a pairing request after the extension's ten minutes even when desk.denied expired never arrives. The next call then sends a new request with a new key and code. A later call while the same request still waits now waits 20 s instead of 0, so the code shows and an Allow is caught. A find request that did not reach the extension no longer waits a second time.

What's not done

  • redrob desk status and the redrob run lines stay English. The CLI has no Korean anywhere (no Hangul and no locale helper in packages/redrob/src/cli), so per the instruction no CLI i18n system was added.
  • The model-facing first line (Browser: …) stays English on purpose.
  • The Chrome pairing prompt is the extension's own Korean ({name}에서 이 브라우저를 쓰려고 해요); the device name Redrob Code on <host> is kept as a product name.
  • The live notice is on the session engine's browser tool (the one the TUI uses). The core v2 tool has no progress channel yet (core/src/tool/bash.ts TODO), so it shows the result only.
  • Windows check: SSH to msi-linux timed out (port 22), so it was skipped.

What to review

  • The Korean wording, and whether the 20 s repeat wait is right.

Checks

  • tui test/util/tool-display.test.ts: 7 new tests (label en/ko, notice while waiting, cleared states, connect hint). The 12 failures in test/i18n are the same 12 as on origin/develop.
  • redrob test/browser/extension.test.ts and test/desk/extension.test.ts: 21 pass. New tests cover the code shown and then cleared on Allow, cleared on fallback, the connect hint given once per session, and an expired request asked again with a fresh code and then allowed.
  • tsgo --noEmit in tui and redrob.
  • tmux on Linux, a real session. A stand-in engine service on 127.0.0.1 waits 15 s with code 123456, then reports no Chrome:
    • ko while waiting: ◎ 브라우저 열기 https://example.com / 크롬에서 허용을 눌러 주세요 (코드 123456). 컴퓨터 알림과 레드롭 확장 옆 패널에 떠요.
    • ko after: ◎ 브라우저 열기 https://example.com (내장 브라우저에서) / 내 크롬을 쓰려면 크롬에 레드롭 확장을 설치하고, …
    • en: ◎ Browser open https://example.com / Press Allow in Chrome (code 123456). …, then (in the built-in browser) / To use your own Chrome, install the Redrob extension …
    • Earlier, without the stand-in: ◎ 브라우저 열기 https://example.com (내장 브라우저에서) and ◎ Browser read https://example.com/ (in the built-in browser).

@its-janghoon
its-janghoon merged commit a84c0af into develop Nov 13, 2026
11 checks passed
@its-janghoon
its-janghoon deleted the fix/browserko branch November 13, 2026 10:38
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.

1 participant