Skip to content

fix(demo): New session answers with the WorkspaceCreated shape instead of blanking the app - #355

Merged
devswha merged 3 commits into
mainfrom
fix/demo-new-session
Oct 2, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/demo-new-session

Conversation

@devswha

@devswha devswha commented Oct 2, 2026

Copy link
Copy Markdown
Owner

What happened

In the public demo, New session -> Shell (or any agent) -> Start session blanked the whole app with TypeError: Cannot read properties of null (reading 'prompt'). A reload recovered it.

Cause

  • site/demo/transport.ts answered POST /api/workspace/create with herdr's raw shape {workspace, root_pane, tab}, not the web contract WorkspaceCreated ({workspace_id, pane_id, agent_started, error?}, shared/protocol.ts). It did add the synthetic workspace and pane to the demo state.
  • NewSessionDialog then called onCreated(result.pane_id) with undefined.
  • In PaneTerminal, secretActive = secret?.pane === paneId is undefined === undefined for a null secret and a missing pane id, so the render passed the paneId !== null guard and dereferenced secret.prompt.

The installed server returns the right shape; only the demo was affected.

Change

  • site/demo/transport.ts: the create handler returns { workspace_id, pane_id, agent_started } satisfies WorkspaceCreated.
  • src/components/PaneTerminal.tsx: secretActive = secret !== null && secret.pane === paneId, so a null secret is never active whatever the pane id is. No change for valid ids.

Validation

The repo keeps no demo transport test or demo browser regression and site/ is not typechecked, so the proof is a browser run: bun run build:site, _site served on 127.0.0.1:7447, headless Chrome via playwright-core at 1180x757, open /demo/app/, New session -> pick the agent -> Start session. PASS needs a non-empty #root, the aria-current sidebar pane to be one that did not exist before, and zero pageerror events.

Before (origin/main 2507b0c):

FAIL [main] Shell: rootChars=0 panes=7->0 selected=null newPaneSelected=false pageerrors=["Cannot read properties of null (reading 'prompt')"]
FAIL [main] Codex: rootChars=0 panes=7->0 selected=null newPaneSelected=false pageerrors=["Cannot read properties of null (reading 'prompt')"]

After (this branch):

PASS [fix] Shell: rootChars=111111 panes=7->8 selected="w2t:p1 — /tmp/herdr-demo/checkout-api — /tmp/herdr-demo/checkout-api" newPaneSelected=true pageerrors=[]
PASS [fix] Codex: rootChars=115912 panes=7->8 selected="w2t:p1 — /tmp/herdr-demo/checkout-api — /tmp/herdr-demo/checkout-api" newPaneSelected=true pageerrors=[]

Screenshots were viewed: before is an empty dark page; after shows the app with the new checkout-api pane open in the header and terminal (with the Codex mark in the Codex run).

  • bun run typecheck: exit 0
  • bun run test:unit: 1050 pass, 3 skip, 0 fail

Fixes #345

@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.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Advanced

Run ID: 4ef33491-673d-4323-ac0a-57037cc80509

📥 Commits

Reviewing files that changed from the base of the PR and between 0d6e98e and 7ba9ac9.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: fcc61993-a4f8-4db0-9487-bedd1ede0aab

📥 Commits

Reviewing files that changed from the base of the PR and between 2507b0c and 0d6e98e.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • site/demo/transport.ts
  • src/components/PaneTerminal.tsx

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


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Starting a new session in the browser demo now opens the session instead of showing a blank page.
    • Secret prompts are now shown only for the pane they belong to.

Walkthrough

The demo workspace creation endpoint now returns the WorkspaceCreated fields. PaneTerminal only activates a secret prompt when the secret exists and matches the pane. The changelog records the new-session behavior.

Changes

Demo session creation and rendering

Layer / File(s) Summary
Workspace creation response contract
site/demo/transport.ts, CHANGELOG.md
The demo create endpoint returns workspace_id, pane_id, and agent_started instead of full workspace, root-pane, and tab objects. The changelog records that starting a new demo session opens that session.
Secret prompt activation check
src/components/PaneTerminal.tsx
secretActive now requires a non-null secret whose pane matches paneId.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: nahwan-kim

Merge Risk: ⚪ Minimal · up to 0d6e9

Creating a session in the browser demo should now open the new session instead of blanking the page. The secret prompt no longer activates when it is null. No merge-blocking risk was found.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 0d6e9

The demo response now matches the existing session-creation contract. The terminal change prevents activation without a secret and preserves existing pane identity and submission controls. No material security risk was identified in these changes.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The corrected creation flow exposes synthetic resources held in the visitor's browser memory, not additional tenant or production-machine authority. The shared terminal predicate affects rendering wherever that component is used, but leaves valid pane/secret pairs and their existing transport calls unchanged.

Trust Boundaries and Controls

  • observed — PTY output is accepted only for the selected pane, and delayed output callbacks check pane ownership and generation before updating secret state. Ordinary terminal input independently checks pane selection, observer mode, secretRef and held state. The activation change does not remove those controls or alter secret-submission arguments.

Resilience and Maintainability Implications

  • observed — Pane changes clear secret state before attaching the next pane, and disconnects invalidate output readiness. Existing secret submission serializes sends, clears the input value, suppresses late updates after unmount and checks connection identity. These lifecycle controls are unchanged. Disconnect does not explicitly clear secretRef, but that pre-existing behavior continues to block ordinary input rather than gaining authority through this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the demo new-session fix and the corrected WorkspaceCreated response. It also states the user-visible blank-app failure.
Description check ✅ Passed The description explains the problem, cause, changes, validation steps, results, and linked issue. It provides browser evidence for the UI and demo transport changes, plus typecheck and unit-test resu…
Linked Issues check ✅ Passed Issue #345 requires the browser demo to create and select Shell and agent sessions without blanking the app. site/demo/transport.ts now imports WorkspaceCreated and returns workspace_id, `pane_i…
Out of Scope Changes check ✅ Passed The changes stay within Issue #345. The transport response change fixes the reported demo contract violation. The PaneTerminal guard protects the same malformed or missing pane-ID failure path. The …
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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 a789999 into main Oct 2, 2026
4 checks passed
@devswha
devswha deleted the fix/demo-new-session branch October 2, 2026 19:54
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: .
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.

Public demo goes blank after New session: create response violates WorkspaceCreated

1 participant