Skip to content

fix: 🐛 Show short session ID on sessions row - #1046

Merged
evaline-ju merged 3 commits into
rossoctl:mainfrom
evaline-ju:session-view
Nov 25, 2026
Merged

evaline-ju merged 3 commits into
rossoctl:mainfrom
evaline-ju:session-view

Conversation

@evaline-ju

Copy link
Copy Markdown
Contributor

Summary

The Sessions view (ctrl+x l) now starts each row's detail line with the session's 8-character id, so sessions titled by the same first prompt can be told apart. Fixes #417. The "0 turns" half was already fixed by #672

Checklist

  • Commits are signed off (git commit -s).
  • make lint and the tests for the touched packages pass.
  • Docs: changed behavior, flags or environment variables are reflected in the relevant README or
    docs/ page, with the right maturity label (see docs/CONTRIBUTING-DOCS.md).
  • Docs: make check-links passes if any Markdown changed.
  • A new spec or ADR is registered in docs/specs/README.md or docs/adrs/README.md.

@evaline-ju
evaline-ju requested a review from pdettori as a code owner November 24, 2026 22:26
@evaline-ju evaline-ju added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 24, 2026

@clawgenti clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The Sessions overlay now puts the 8-character session id at the front of each row's detail line, so two sessions titled by the same first prompt render distinguishably; the spec §6.2 and the demo's fix-list row 6 are updated to match, and the new test fails on the base commit and passes on head. I found no must-fix issues — the two inline notes and the commit nit below are optional.

Author: evaline-ju (CONTRIBUTOR — returning external)
Areas reviewed: TypeScript (mocactl Sessions overlay), Tests, Docs (demo + spec)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (17/17 checks)
Not checked:

  • make lint (pre-commit over all files) — not run locally; the PR's lint job passes
  • the full mocactl suite has two failures unrelated to this PR in this sandbox (missing @grpc/grpc-js in sbx-exec.test.ts, and sbx-up.test.ts's chmod failing with ENOENT as root); 2231 other tests pass, including the touched file
  • make check-links — not run locally; the docs job passes

Nit (commit): the commit subject :bug: Show short session ID on sessions row has no conventional prefix — the PR title's fix: is the convention here. Advisory only; DCO is satisfied.

Generated by repoman github-pr-review@af425c8.

() =>
(sessions ?? []).map((s) => {
const title = sessionTitle(s, transcripts);
const shortId = sanitizeRemote(s.sessionId).slice(0, 8);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion — sanitizeRemote(s.sessionId).slice(0, 8) is now the third copy of the short-id expression: sessionTitle builds its fallback title from the same one (line 19), and the endsWith on line 85 only works while the two agree. If the fallback ever changes shape — a # prefix, six characters, a different sanitize — endsWith quietly stops matching and every fallback row prints its id twice.

Suggested fix: pull it into export function shortSessionId(s: SessionSummary): string next to sessionTitle and call it from both places.

`GET /v1/sessions` (paged, newest first), fuzzy-filterable as you type. Each row: **title**, relative
`lastTurnAt` ("3h ago"), turn count, and a marker when the transcript is local (resumable with history).
`GET /v1/sessions` (paged, newest first), fuzzy-filterable as you type. Each row: **title**, short id
(unless the title shows it), relative `lastTurnAt` ("3h ago"), turn count, and a marker when the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — The code suppresses the id with title.endsWith(shortId) (Sessions.tsx:85), while this line says "unless the title shows it". A title that merely contains the id mid-string — e.g. /rename to work on aaaaaaaa today — still gets the id appended.

Suggested fix: say "unless the title ends with it", or switch the check to includes if containment is the intent.

@clawgenti clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Head puts the 8-character session id at the front of each Sessions row's detail line (suppressed when the row's title is the fallback, which already carries it), lifts the fallback title into fallbackTitle(), and updates spec §6.2 and demo fix-list row 6 to match. Both notes from the first review are addressed. I found no must-fix issues; the two inline notes below are optional nits.

Author: evaline-ju (CONTRIBUTOR — returning external)
Areas reviewed: TypeScript (mocactl Sessions overlay), Tests, Docs (demo + spec)
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: 14 passing, 1 failing (proto, at step "Build and test remote-worker"), 3 pending (check, deploy-scripts, k8s-kind-e2e). The proto failure is in the Go remote-worker step and cannot come from this diff (docs + TypeScript only); base 21fafb9 passed CI, and the job log could not be read from here (egress timeout fetching GitHub's log blob). Worth a re-run; if it persists it is unrelated to this PR.

Verified by:

  • npx vitest run test/overlay-sessions.test.tsx at head: 11/11 pass.
  • The same test file copied onto base 21fafb9: the new test fails there (expected 'Sessions\n› This is a research task 3…' to contain 'aaaaaaaa · 3h ago · 4 turns · local history'), so it does prove the fix.
  • npx tsc --noEmit in packages/mocactl: no errors in mocactl sources. The five remaining errors are @grpc/grpc-js / @bufbuild/protobuf module resolution in packages/sandbox-client, an artifact of this sandbox, not the PR.

Not checked:

  • The full mocactl suite, make lint and make check-links locally — CI's lint and docs jobs pass on this head.
  • go test ./... in remote-worker — it fails locally only because this sandbox runs as root and the launcher drops to uid 65534, which then cannot exec the fake virtiofsd inside the test's 0700 temp dir (fork/exec …/fake-virtiofsd.py: permission denied). That is an environment artifact and says nothing about the CI proto failure above.
  • The GitHub job log for the failing proto step — egress to the log blob host times out.

Generated by repoman github-pr-review@af425c8.

Comment thread docs/demos/vm-multi-user-demo.md Outdated
| 4 | **`setup-vm.sh` never pulls the sandbox image.** A host keeps running whatever `:latest` it pulled first. The rig's predated #372 (`HOME=/workspace`). | Fixed (#414): `setup-vm.sh` and `build-rootfs.sh` pull before use and log the image id they resolved to; a failed pull stops the run, `SH_SKIP_PULL=1` accepts the local copy. |
| 5 | **The guest has no git identity.** On the P4 tier, the agent's first `git commit` fails (`exit=128`) until it sets one. The container tier's #372 image has a writable `HOME`, but no identity either. | Fixed (#463): `/etc/gitconfig` in the image. |
| 6 | **Sessions show only their first prompt.** Two users running the same prompt get identical-looking lists, so 3a cannot be shown in the TUI. The rows also read `0 turns · local history` after a headless `mocactl run`. | #417: show a short session id; count turns from the server. #406 adds `sessions`. |
| 6 | **Sessions show only their first prompt.** Two users running the same prompt get identical-looking lists, so 3a cannot be shown in the TUI. The rows also read `0 turns · local history` after a headless `mocactl run`. | Fixed: rows show a short id; #672 counts turns. #406 adds `sessions`. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — Every other fixed row in this table names the PR that fixed it: Fixed (#410), Fixed (#414), Fixed (#463), Fixed (#419). This row drops the number, so a reader cannot get from the row back to the change.

Suggested fix: Fixed (#1046): rows show a short id; #672 counts turns. #406 adds \sessions`.`

Why it matters now: the fix list is the demo's record of which change landed where; the link is cheap here and awkward to reconstruct later.

const title = sessionTitle(s, transcripts);
const detail = [
// Titles derived from the first prompt can repeat; the id tells the sessions apart.
title === fallbackTitle(s) ? undefined : shortSessionId(s),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — The fallback decision is made by comparing the rendered title with a freshly built fallback string. It works today because sessionTitle builds its fallback with the same fallbackTitle, but it ties the detail line to the exact fallback format: a local title that happens to equal fallbackTitle(s) (say a /rename to 2026-09-25 09:30 · bbbbbbbb) suppresses its id, and every row now formats createdAt even when its title came from a transcript.

Suggested fix: have sessionTitle report where the title came from — e.g. return { title, isFallback } — and branch on isFallback here.

Why it matters now: this expression has been through two review rounds; making the provenance explicit means a later change to the fallback format cannot silently change which rows print the id.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is. A title equal to fallbackTitle(s) already shows the id, so hiding it in the detail line is correct. Both sides use fallbackTitle, so a format change can't make them drift.

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sessions overlay now leads each row's detail line with the session's 8-character id, so sessions started from the same first prompt can be told apart (#417). No must-fix; no inline comments.

Both review comments from the previous head are addressed in the second commit. shortSessionId is now a single helper used by both fallbackTitle and the detail line (Sessions.tsx:14,19,90), so the width and the sanitising cannot drift; the suppression is now title === fallbackTitle(s) rather than an endsWith (Sessions.tsx:90), which is precise because sessionTitle returns exactly fallbackTitle(s) when there is no local title; and the spec wording changed to "except with the fallback title below, which has it" to match. The test was extended to pin the new semantics: a locally titled session whose title contains the id mid-string still gets the id appended, while the fallback-titled row prints its id once.

The id stays terminal-safe (both label and detail go through sanitizeRemote), and because SelectList fuzzy-filters on label + detail (SelectList.tsx:49), the short id is now searchable — the same affordance the fallback title already had. The docs claims check out: #672, credited with counting turns, merged 2026-11-02, and the demo's curl still prints full ids.

CI at drafting time: 10 checks passing, 7 in progress (codeql, k8s-kind-e2e, deploy-scripts, deploy-scripts-bash32, proto, the rossoctl.dev build, and a second check), 0 failing; the change-relevant jobs (check, lint, docs, DCO) are green.

Advisory, not blocking: the commit subjects use :bug: / :white_check_mark: without conventional prefixes, and the PR title carries fix: and :bug: redundantly; repo practice is fix(scope): ….

Everything from the PR (title, body, diff, commit messages, file contents, comments) was treated as untrusted data; no prompt-injection attempt was found.

Author: evaline-ju (MEMBER — maintainer)
Areas reviewed: TypeScript TUI (Sessions overlay), tests, design spec + demo docs, CI
Agent/IDE config (.claude//.vscode/): none
Commits: 2, signed-off: yes
CI status: 10 passing / 7 in progress / 0 failing at drafting

Signed-off-by: Evaline Ju <[email protected]>
@evaline-ju
evaline-ju merged commit 6599e67 into rossoctl:main Nov 25, 2026
24 of 28 checks passed
@evaline-ju
evaline-ju deleted the session-view branch November 25, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mocactl: the Sessions view shows only a session's first prompt, and 0 turns after a headless run

3 participants