Skip to content

Workspace UI: paginate session directory (#183) and preserve composer drafts (#185) - #199

Merged
harshsaver merged 4 commits into
mainfrom
fix/183-185-workspace-ui
Nov 14, 2026
Merged

harshsaver merged 4 commits into
mainfrom
fix/183-185-workspace-ui

Conversation

@harshsaver

Copy link
Copy Markdown
Member

Batch A (workspace-UI intermediate JS).

Fixes #183, Fixes #185.

#183 — sessions after the first 100 selectable

  • messagesView() recipient/filter dropdowns and the channel author-name directory now follow the existing after/nextCursor session pages (bounded at 50 pages, de-duplicated by id) instead of using only the first page.
  • Duplicate display names are disambiguated with the device name; offline · offline suffixes retained.
  • Pages that arrive after a tab re-render or workspace switch are discarded, so stale directory results can never leak into the new workspace.

#185 — draft preservation

  • Unsent conversation text + recipient selection and per-channel/per-thread post bodies (including inserted attachment references) are kept in an in-memory map keyed by account + workspace + destination. Nothing is written to browser storage and nothing auto-sends.
  • Drafts survive tab navigation and non-send refreshes; only the submitted draft is cleared after a confirmed send, and failed sends retain the draft with its idempotency key for safe retry.
  • Sign-out forgets that account's drafts, so a different account never sees them.

Tests

  • New mocked browser coverage in web/tests/workspace.spec.js: 101-session two-page directory with duplicate names + delayed-stale workspace switch; draft survival across tabs/refresh/workspace-switch with attachment URI and no-storage assertion; failed-send key reuse; independent channel/thread drafts; cross-account isolation via sign-out/sign-in.
  • npx playwright test: 19/19 pass. Bundle regenerated with npm run build.

Fetch all session pages (bounded, stale-guarded) for the conversation
recipient/filter dropdowns and channel author names, disambiguating
duplicate display names while keeping offline labels. Stale directory
pages arriving after a workspace switch are discarded.

Keep unsent conversation and channel/thread drafts in memory, scoped to
account, workspace and destination. Drafts survive tab navigation and
refreshes, retain their idempotency key across failed sends, and clear
only after a confirmed send. Sign-out forgets that account's drafts.

Fixes #183, Fixes #185.
@harshsaver

Copy link
Copy Markdown
Member Author

Merged origin/main into this branch (2157862) to resolve the conflict with #192. web/src/app.js auto-merged; the generated bus/hostedweb/app.js bundle was rebuilt with web's own build (npm run build) rather than hand-edited. Go build passes locally; CI re-running.

@harshsaver

Copy link
Copy Markdown
Member Author

🤖 Agentbox PR audit: changes requested

What needs to change

The two features work and CI is green. Six edge cases in the new code need closing before merge. Everything is in web/src/app.js (about 30 lines) plus tests; no new dependency, storage or abstraction.

  1. Fix the draft key per view.

    • Replace draftScope / getDraft / setDraft (:69-71) with const draftKey = name => `${state.user.id}\n${state.workspace.id}\n${name}`;.
    • In messagesView and channelsView, compute the key right after const scopePath = path(''), before the first await. For channels, capture draftKey('channel') there and append \n${channel.id}\n${state.threadId || ''} later.
    • Use drafts.get / drafts.set / drafts.delete with that key.
    • Why: the key is resolved when the draft is touched, so a send that finishes after a workspace switch clears the other workspace's draft.
  2. A composer that has left the screen must not write.

    • In attachmentPicker (:125), after uploadFile resolves: if (!textInput.isConnected) { inform('File uploaded. Copy its reference from Files to share it.'); return; }.
    • Why: the late completion currently saves the old textarea into whichever workspace or account is current, or over newer edits.
  3. Clear only what was sent.

    • In both submit handlers, read const { key } = drafts.get(id) before the POST, and afterwards if (drafts.get(id)?.key === key) drafts.delete(id);.
    • Why: text typed while the send is pending is currently deleted.
  4. Recipient rules in messagesView.

    • Add function openConversation(id) { state.conversationAgent = id; const key = draftKey('message'); if (!drafts.get(key)?.body) drafts.delete(key); }. Call it from "Open conversation" (:279) and the filter onchange (:370). A recipient picked without text must still survive tab changes and refreshes.
    • On restore, when the draft has text and its recipient is no longer listed: target.prepend(el('option', { value: '' }, 'Recipient unavailable — choose a session')); target.value = '';. The select's required then blocks sending until a choice is made. Never fall back to another session for a draft with text.
  5. Finish the labels. Replace sessionLabels with:

    function sessionLabels(sessions) {
      const tally = labels => { const counts = new Map(); for (const label of labels) counts.set(label, (counts.get(label) || 0) + 1); return counts; };
      const onDevice = s => s.deviceName === s.displayName ? s.displayName : `${s.displayName} · ${s.deviceName}`;
      const names = tally(sessions.map(s => s.displayName)), devices = tally(sessions.map(onDevice));
      return new Map(sessions.map(s => [s.id, names.get(s.displayName) === 1 ? s.displayName : devices.get(onDevice(s)) === 1 ? onDevice(s) : `${onDevice(s)} · ${s.id}`]));
    }
  6. Load the whole directory. In fetchSessions, remove pages + 1 >= 50; stop when there is no nextCursor or a page added no new session. Do not add a load-more control or change the server.

  7. Tests in web/tests/workspace.spec.js, using held responses rather than timers:

    • Labels: two sessions with the same name and device, and two whose name equals their device, get distinct labels.
    • Paging: a directory served over more than 50 pages exposes its last session as a recipient.
    • Recipient: one picked without text survives Tasks → Conversations; after typing and deleting, "Open conversation" on another session selects that session.
    • Late upload: hold the upload in workspace 1, give workspace 2 its own draft, switch, release. Workspace 2's draft is unchanged, workspace 1's draft has its original text, and the "File uploaded" notice shows.
    • Pending send: hold the POST, type new text, release. The new text is still in the composer and the sent message is listed.
    • Missing recipient: a draft with text whose session disappears on refresh shows the placeholder, and clicking Send makes no POST.
    • Retry: after a failed send, go to Tasks and back, send again, and assert the same idempotency key.
  8. Rebuild with npm run build in web/ and commit the regenerated bus/hostedweb/app.js; do not hand-edit it.

To test: in web/, run npm ci --ignore-scripts, npm run build, git diff --exit-code -- ../bus/hostedweb, npx playwright install chromium, npm test.

What this PR changes

  • What it does: Lets Conversations and Channels see sessions beyond the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • After revision, any session can be picked as a recipient or filter in workspaces with more than 100 sessions.
    • Sessions with the same name get the device name added; offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send. Drafts live only in the open page, never in browser storage.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Not yet. The main flows work by inspection and CI is green, but the edges can misplace or misaddress a message:
    • A draft can land in, or be erased from, another workspace if you switch while an upload or send is still running.
    • A draft can end up addressed to a different session than the one you opened, or than the one it was written for.
    • Text typed while a send is still pending is thrown away.
    • Same-name labels can still be identical (for example "Claude · Claude" twice).
    • The session list stops silently at 5,000.
  • What to expect after merging: Once revised, navigation keeps unfinished work without changing whom it is for. To watch later: the whole session list is re-downloaded on every redraw of Conversations and Channels, so load time grows with directory size. Performance work can be additive; no picker redesign is required to close the correctness bugs here.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 4 turns, commit 2157862)

PR audit: #199 — Workspace UI: paginate session directory (#183) and preserve composer drafts (#185)

Head: 2157862

Sign-off

  • Claude (fable, xhigh): ❌ not satisfied — I agree with "comment" and with all six problems, but Codex's requested revision is heavier than the code needs; I replaced it with a smaller exact change list that Codex must re-check
  • Codex (gpt-6-astra, xhigh): ✅ satisfied — verified the smaller remedies against the code and browser standards; agree with all six findings, the developer change list and the comment decision

Decision

comment — six edge cases in the new draft, recipient, label and paging code need closing; each fix is small, but together with their tests they exceed what we should apply blind on the branch.

What changes (plain language)

  • What it does: Lets Conversations and Channels see sessions beyond the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • After revision, any session can be picked as a recipient or filter in workspaces with more than 100 sessions.
    • Sessions with the same name get the device name added; offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send. Drafts live only in the open page, never in browser storage.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Not yet. The main flows work by inspection and CI is green, but the edges can misplace or misaddress a message:
    • A draft can land in, or be erased from, another workspace if you switch while an upload or send is still running.
    • A draft can end up addressed to a different session than the one you opened, or than the one it was written for.
    • Text typed while a send is still pending is thrown away.
    • Same-name labels can still be identical (for example "Claude · Claude" twice).
    • The session list stops silently at 5,000.
  • What to expect after merging: Once revised, navigation keeps unfinished work without changing whom it is for. To watch later: the whole session list is re-downloaded on every redraw of Conversations and Channels, so load time grows with directory size. Performance work can be additive; no picker redesign is required to close the correctness bugs here.

Findings

Blocking

  1. web/src/app.js:69-71, :125, :417-431, :519-531 — draft reads and writes use the account and workspace current at that moment, not the ones the view was built for. (Both reviewers agree.)

    • draftScope() reads mutable global state on every access. The workspace switcher changes it synchronously (:212), and render() detaches the old view without cancelling its upload or send (:263; uploads may run 30 s, :99).
    • Late upload: start "Upload and attach" in workspace A and switch to B. The detached textarea receives the reference and dispatches input (:125), and saveDraft stores A's text and recipient under B's message key. B's own draft is overwritten and A's text shows in B's composer on the next redraw. The same path crosses accounts if a sign-out and another sign-in complete inside the upload window.
    • Late send: send in A and switch to B before the response. setDraft('message', null) (:431) deletes B's draft and keeps A's already-sent text. Channels and threads have the same pattern (:523-531).
    • Impact: breaks Workspace UI: preserve unsent messages and channel replies while navigating #185's "never appear elsewhere". Draft text can be shown to, and then sent into, the wrong workspace.
    • Smallest fix: (a) compute the key once per view, before its first await; (b) in attachmentPicker, do nothing to the textarea when !textInput.isConnected.
    • Pushback on turn 2, accepted by Codex: an authentication epoch or swapped map is not needed. With (b), drafts are written only by user input on an on-screen composer or by the submit handler before its await; after the await there is only a delete. Sign-out clears drafts and detaches the view in one synchronous step (:166-184), so nothing can recreate a cleared draft.
  2. web/src/app.js:419-423, with :279 and :370 — a draft with no text overrides the conversation the user opened. (Both agree.)

    • Any input or recipient change stores a draft, including {to, body: ''} after typing and deleting. Restore then prefers that recipient over state.conversationAgent (:415, :419).
    • Repro: type and delete a character while addressed to session A, go to Sessions and click "Open conversation" on B. History shows B; "Send to" still says A.
    • Impact: regression from main, where the composer follows the opened conversation; the next request can go to the wrong agent.
    • Agreed correction: keep a recipient chosen without text across passive navigation, and release a text-less draft only on an explicit conversation choice.
    • Addition: the filter dropdown (:370) is also an explicit choice and needs the same release, otherwise the trap remains through the filter.
  3. web/src/app.js:85-92 — duplicate-name labels stay identical in ordinary setups. (Both agree.)

    • OAuth and MCP-key connectors use the device name as the session name (bus/hosted_oauth.go:305; bus/hosted_oauth_tokens.go:31,262; bus/hosted_mcp_keys.go:53,83,99; bus/hosted_devices.go:426). Two "Claude" connections both show "Claude · Claude".
    • Terminal sessions default to "Claude Code" / "Codex" (cmd/agentintercom/session_native.go:178-185) on a device named after the hostname (cmd/agentintercom/hosted_login.go:131-135). Two on one machine get the same label.
    • The new test covers only different device names (web/tests/workspace.spec.js:320-322).
    • Smallest fix: skip a device suffix equal to the name, and append the session ID when name plus device still collide.
  4. web/src/app.js:125, :420-431, :522-531 — a late completion overwrites or deletes a newer version of the same draft. (Codex's finding; verified.)

    • Send: only the submit button is disabled during a send (:39-49). Text typed while the POST is pending is saved, then success unconditionally deletes the entry and redraws. This is not a regression (main also discards it, because the view is rebuilt), but Workspace UI: preserve unsent messages and channel replies while navigating #185 says to clear only what was sent, and the guard is one line.
    • Upload: start an upload, leave and return to the same composer, edit, then the upload finishes. The detached textarea's old text plus the reference replaces the newer stored draft. This is new in the PR.
    • Smallest fix: delete after a send only if the stored draft still carries the key that was sent. The upload half is closed by the isConnected guard in finding 1.
    • Pushback on turn 2, accepted by Codex: routing a late upload "through the original draft's state" and updating the visible replacement composer is not required. Workspace UI: preserve unsent messages and channel replies while navigating #185 asks to keep inserted references; an upload abandoned mid-flight was never inserted, main already drops it, and the file stays available under Files → "Copy reference" (:142). Telling the user where the file is suffices.
  5. web/src/app.js:415-419 — a draft with text silently takes another recipient when its saved session is gone. (Codex's finding; verified.)

    • The body is restored first; if restored.to is not in sessions, the select keeps its default and Send is enabled.
    • Sessions do disappear: removing a member deletes hosted_members (bus/hosted_devices.go:58-66), which cascades through devices and hosted sessions (deploy/hosted/migrations/002_workspaces.sql:47,53); the directory query inner-joins both (bus/hosted_views.go:39-41). The turn-1 statement that the directory only grows was wrong.
    • Smallest fix: when a draft with text has no matching recipient, select an empty placeholder option so the select's existing required blocks sending until the user chooses.
  6. web/src/app.js:73-83 — the 50-page stop silently drops sessions after 5,000. (Both agree on the problem and the smaller remedy.)

    • After page 50 the helper returns what it has, even with a nextCursor. Session 5,001 cannot be chosen or filtered, and "Open conversation" on it leaves the composer on another session. Normal retention never removes sessions (bus/storage.go:309-316 prunes messages, tasks, posts, escalations and events only), and the 50-session limit is concurrent (bus/hosted_devices.go:405-424).
    • Correction to turn 1: a silent cutoff that can redirect a message should not ship as "acceptable for beta".
    • Smallest fix: remove the page ceiling and follow nextCursor to the end, stopping if a page adds no new session. The server cursor strictly advances (bus/hosted_views.go:41) and the existing stale check ends abandoned loads. This keeps the server's page bound and reuses after/nextCursor, as Workspace UI: make sessions after the first 100 selectable in conversations #183 requires.
    • Pushback on turn 2, accepted by Codex: a continuation control or paged selector is not necessary to correct truncation. Following the existing cursor to exhaustion is the smaller complete fix. Load time at scale stays the non-blocking concern below; no measured performance failure establishes a need to replace the picker in this PR.

Non-blocking

  • Repeated directory loading. web/src/app.js:362 and :497 await every directory page before the view paints, and each redraw repeats it. Load time grows with the directory. A measured performance follow-up could consider caching or a searchable/paged picker. No performance measurement was run. Clarification of turn 3: Workspace UI: make sessions after the first 100 selectable in conversations #183 prohibits removing the server's page bound, not all server changes; a separate continuation control can coexist with a native select and could improve time to first interaction. None is required for the agreed correctness fix.
  • Late-send continuation is pre-existing. After a send, state.conversationAgent / state.search are set and render() runs unconditionally (:432, :532; unchanged context in this diff). If the user switched workspace or signed out meanwhile, that redraws the wrong place or raises an error toast on the sign-in page. Same on main, so not required here.
  • Upload notice context. The proposed fallback notice refers to Files in the original workspace: uploadFile posts to the captured scopePath (:103-108). Switching workspace does not move the uploaded file. Making that workspace context explicit would improve the notice's wording.
  • History labels. Conversation rows and channel authors still use the raw displayName (:364, :499); reusing the improved labels would be consistent.
  • Small simplifications.
    • session.agentId is not in the response (bus/protocol.go:55-65), and names are validated non-empty (bus/hosted_devices.go:152,348; bus/hosted_oauth.go:85-88), so those fallbacks are dead.
    • The token objects (:361, :496) could be the plain generation number.
    • Keep both account-scoped keys and the sign-out clear; they do different jobs. The earlier suggestion to treat them as redundant is withdrawn.
  • Idempotency key on edit-then-undo. Every edit rotates the key (:423, :524). If an uncertain send actually landed and the user edits and reverts before retrying, it can duplicate. Rare.
  • Test strength. The stale-page assertion (web/tests/workspace.spec.js:367-368) can run before the browser could request another page, so it does not prove continuation stopped. The account test (:461-482) checks another account, not that sign-out cleared drafts for the same one.
  • Docs. docs/hosted-workspaces.md:148 stays accurate. The PR description says 19 tests; the spec has 21 after merging main.

Fix plan

n/a

Message to the developer

The two features work and CI is green. Six edge cases in the new code need closing before merge. Everything is in web/src/app.js (about 30 lines) plus tests; no new dependency, storage or abstraction.

  1. Fix the draft key per view.

    • Replace draftScope / getDraft / setDraft (:69-71) with const draftKey = name => `${state.user.id}\n${state.workspace.id}\n${name}`;.
    • In messagesView and channelsView, compute the key right after const scopePath = path(''), before the first await. For channels, capture draftKey('channel') there and append \n${channel.id}\n${state.threadId || ''} later.
    • Use drafts.get / drafts.set / drafts.delete with that key.
    • Why: the key is resolved when the draft is touched, so a send that finishes after a workspace switch clears the other workspace's draft.
  2. A composer that has left the screen must not write.

    • In attachmentPicker (:125), after uploadFile resolves: if (!textInput.isConnected) { inform('File uploaded. Copy its reference from Files to share it.'); return; }.
    • Why: the late completion currently saves the old textarea into whichever workspace or account is current, or over newer edits.
  3. Clear only what was sent.

    • In both submit handlers, read const { key } = drafts.get(id) before the POST, and afterwards if (drafts.get(id)?.key === key) drafts.delete(id);.
    • Why: text typed while the send is pending is currently deleted.
  4. Recipient rules in messagesView.

    • Add function openConversation(id) { state.conversationAgent = id; const key = draftKey('message'); if (!drafts.get(key)?.body) drafts.delete(key); }. Call it from "Open conversation" (:279) and the filter onchange (:370). A recipient picked without text must still survive tab changes and refreshes.
    • On restore, when the draft has text and its recipient is no longer listed: target.prepend(el('option', { value: '' }, 'Recipient unavailable — choose a session')); target.value = '';. The select's required then blocks sending until a choice is made. Never fall back to another session for a draft with text.
  5. Finish the labels. Replace sessionLabels with:

    function sessionLabels(sessions) {
      const tally = labels => { const counts = new Map(); for (const label of labels) counts.set(label, (counts.get(label) || 0) + 1); return counts; };
      const onDevice = s => s.deviceName === s.displayName ? s.displayName : `${s.displayName} · ${s.deviceName}`;
      const names = tally(sessions.map(s => s.displayName)), devices = tally(sessions.map(onDevice));
      return new Map(sessions.map(s => [s.id, names.get(s.displayName) === 1 ? s.displayName : devices.get(onDevice(s)) === 1 ? onDevice(s) : `${onDevice(s)} · ${s.id}`]));
    }
  6. Load the whole directory. In fetchSessions, remove pages + 1 >= 50; stop when there is no nextCursor or a page added no new session. Do not add a load-more control or change the server.

  7. Tests in web/tests/workspace.spec.js, using held responses rather than timers:

    • Labels: two sessions with the same name and device, and two whose name equals their device, get distinct labels.
    • Paging: a directory served over more than 50 pages exposes its last session as a recipient.
    • Recipient: one picked without text survives Tasks → Conversations; after typing and deleting, "Open conversation" on another session selects that session.
    • Late upload: hold the upload in workspace 1, give workspace 2 its own draft, switch, release. Workspace 2's draft is unchanged, workspace 1's draft has its original text, and the "File uploaded" notice shows.
    • Pending send: hold the POST, type new text, release. The new text is still in the composer and the sent message is listed.
    • Missing recipient: a draft with text whose session disappears on refresh shows the placeholder, and clicking Send makes no POST.
    • Retry: after a failed send, go to Tasks and back, send again, and assert the same idempotency key.
  8. Rebuild with npm run build in web/ and commit the regenerated bus/hostedweb/app.js; do not hand-edit it.

To test: in web/, run npm ci --ignore-scripts, npm run build, git diff --exit-code -- ../bus/hostedweb, npx playwright install chromium, npm test.

Questions for Harsh

n/a

Verification

  • Method: read-only inspection of code, diff and history by both reviewers. No application dependencies were installed and no build, typecheck, lint, test suite or browser reproduction was run. Findings and proposed remedies were verified by code traces and documentation, not execution. Turn 2 also used the read-only git diff --check whitespace check.
  • Read (both reviewers):
  • Re-checked in turn 3 (Claude):
    • The member-removal cascade: bus/hosted_devices.go:58-66; deploy/hosted/migrations/002_workspaces.sql:47,53,57.
    • Retention scope: bus/storage.go:309-316.
    • Only the submit button is disabled during a send: web/src/app.js:39-49.
    • Sign-out clears drafts and detaches the view with no await in between: :166-184.
    • The post-send state change and redraw are unchanged context lines in the diff.
  • Re-checked in turn 4 (Codex):
    • HEAD remains unchanged, and only AUDIT.md is untracked. Used the supplied turn-3 audit as the current document; the local file still contained turn 2.
    • Re-read the authored source diff, every draft read/write, upload completion, sign-out, both submit handlers, both explicit conversation-choice handlers, directory paging and the supporting server/schema code. Re-read the proposed seven test cases against the fixture and existing coverage.
    • The detached-textarea guard closes the only asynchronous draft-write path; key-matched deletion cannot clear a newer draft, including one created after signing back into the same account. No authentication epoch or draft-store replacement is needed for these paths.
    • Checked isConnected against the DOM Standard, and the first empty option plus required against the HTML select validation rules. These support the proposed guards without additional libraries.
    • The cursor query orders strictly after the prior ID and returns 100 rows plus continuation. Removing the frontend ceiling preserves bounded server requests and closes truncation; no measured performance failure requires a picker redesign here.
  • Remote evidence: re-fetched the PR, discussion, #183 and #185. The PR is MERGEABLE/BLOCKED with REVIEW_REQUIRED and all 11 checks green on this head. The workspace-ui job rebuilds the bundle, fails on drift from the committed file and runs Playwright (.github/workflows/ci.yml:171-176). This is CI evidence for the existing tests, not for the missing cases.
  • Checks after the revision: in web/: npm ci --ignore-scripts, npm run build, git diff --exit-code -- ../bus/hostedweb, npx --no-install playwright install --with-deps chromium, npm test. Then go build ./... and go test ./bus/... for the embedded assets. There are no separate web lint or typecheck scripts. Agreement on this comment decision does not mean the current PR is ready for merge or that these checks should run during this audit.
  • Workspace: only the untracked shared AUDIT.md was written; no tracked file changed and nothing was changed on GitHub.

Audit log

  • Turn 1 (Claude (fable, xhigh)): Read the PR, both issues, the full source and test diff, the surrounding view code, and the server code for session paging, naming and idempotency. Wrote the first audit: three blocking small defects (draft key resolved lazily so late uploads or sends cross workspaces; text-less draft overrides "Open conversation"; duplicate labels ineffective for connector and same-device sessions), seven non-blocking notes, and an exact fix plan. Decision: fix.
  • Turn 2 (Codex (gpt-6-astra, xhigh)): Independently verified the original three findings and CI evidence; expanded isolation to pending callbacks across account changes; added same-draft send/upload races and silent retargeting when a recipient disappears; promoted the 5,000-session cutoff to blocking against Workspace UI: make sessions after the first 100 selectable in conversations #183 and the long-term ruleset. Disputed the empty-draft deletion, incomplete sign-out fencing, "directory only grows" claim and timing strength of the stale-page assertion. Replaced the small fix plan with a developer revision request and changed the decision to comment. No tests/builds or tracked-source changes.
  • Turn 3 (Claude (fable, xhigh)): Re-verified Codex's findings 4-6 against the code (member-removal cascade, retention scope, form disabling) and accepted all six problems and the comment decision. Conceded three points: recipient-only drafts should be kept, "directory only grows" was wrong, and the silent 5,000 cutoff should not ship. Disputed the size of the remedy: an authentication epoch, routing late uploads through draft state with visible-composer sync, and a continuation UI are unnecessary. Replaced the developer message with a smaller exact list (per-view key, isConnected guard, key-matched clear, explicit-choice release plus unavailable-recipient placeholder, labels, uncapped paging with a no-progress stop) and a seven-case test list. Added that the filter dropdown needs the same release as "Open conversation", and moved the late-send redraw to non-blocking as pre-existing.
  • Turn 4 (Codex (gpt-6-astra, xhigh)): Verified Claude's smaller remedies against every draft-write path, synchronous sign-out, key rotation, recipient validation, server cursor ordering and browser standards. Accepted the detached-upload guard, key-matched clear and complete cursor traversal; withdrew the requirements for an authentication epoch, replacement-composer synchronization and a continuation UI. Retained all six blockers, the comment decision and the developer change list. Clarified only rationale, performance/notice wording and verification evidence. Satisfied with the audit; no material changes, tests/builds or tracked-source changes.

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

… paging (#199)

Per-view draft keys computed before the first await; detached-composer
upload guard; key-matched draft clear on send; explicit-choice recipient
release plus unavailable-recipient placeholder; collision-proof session
labels; uncapped directory paging with no-progress stop. Seven new
Playwright regression tests; bundle rebuilt with web's own build.
@harshsaver

Copy link
Copy Markdown
Member Author

Pushed 32bc542 addressing the round-1 audit (all six blockers plus the seven tests and rebuild):

  1. Per-view draft key. draftScope/getDraft/setDraft replaced with draftKey; messages and channels capture their key right after scopePath, before the first await (channels appends channel/thread later). Late sends/uploads can no longer touch another workspace's draft.
  2. Detached composer never writes. attachmentPicker returns early with a "File uploaded. Copy its reference from Files to share it." notice when the textarea left the screen.
  3. Key-matched clear. Both submit handlers delete the draft only if the stored key still matches the sent one, so text typed mid-send survives.
  4. Recipient rules. New top-level openConversation releases only text-less drafts, called from "Open conversation" and the filter; a draft with text whose session vanished gets an empty "Recipient unavailable" placeholder so required blocks Send. A recipient picked without text still survives tab navigation.
  5. Labels. sessionLabels replaced verbatim: name==device collapses, residual collisions get the session id.
  6. Full paging. 50-page ceiling removed; stops on missing cursor or a page adding no new session.
  7. Tests + rebuild. Seven new Playwright cases (labels, 55-page paging, recipient, late upload, pending send, missing recipient, retry-after-navigation) using held responses, no timers; bundle rebuilt with npm run build, not hand-edited.

Local gates on the exact head: Playwright 28/28 pass, go build ./... clean, go test ./bus/... pass. CI re-running. Spec now has 28 tests (description still says 19 — will update at merge time).

@harshsaver

Copy link
Copy Markdown
Member Author

🤖 Agentbox PR audit: changes requested

What needs to change

We tried to apply these fixes ourselves but stopped: Committed fix-plan steps 1-3 as ec44ee3 (web/src/app.js:418 guard no longer requires a non-empty saved recipient; both test extensions added exactly as planned). Step 4 is NOT done: bus/hostedweb/app.js was not regenerated, because web/ has no node_modules and this step forbids installing dependencies and running builds, and the plan forbids hand-editing the bundle. The committed bundle is now stale against the source and still ships the old guard until someone runs npm run build in web/ and commits the result.

Please apply the fix plan.

n/a

What this PR changes

  • What it does: Lets Conversations and Channels see every session, not only the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • Any session can be picked as a recipient or filter, however many the workspace has.
    • Sessions with the same name are told apart: the device name is added, and the session ID when that is still not enough. Offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send; text typed while a send is still in progress is kept.
    • "Open conversation" and the session filter move the composer to that session unless you already have unsent text for someone else.
    • After the remaining fix, if the session a draft was written for disappears, the composer keeps saying "Recipient unavailable — choose a session" until you pick one, including after editing and navigating.
    • Drafts live only in the open page, never in browser storage, and are forgotten on sign-out.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Almost. The developer addressed all six earlier findings and CI is green; five are closed and the recipient guard needs one correction. After "Recipient unavailable" appears, editing the text and then leaving and returning silently points the draft at another session. The fix plan closes that gap.
  • What to expect after merging:
    • The whole session list is re-downloaded each time Conversations or Channels redraws, so load time grows with directory size; performance improvements can be a separate follow-up.
    • A draft with text keeps its recipient even when you open another session's conversation; the "Send to" field shows who it is for.
    • The PR description is out of date: it still says 19 tests, a 50-page limit and device-name-only labels. The developer says the description will be updated at merge.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit 32bc542)

PR audit: #199 — Workspace UI: paginate session directory (#183) and preserve composer drafts (#185)

Head: 32bc542

Sign-off

  • Claude (fable, xhigh): ✅ satisfied — all six earlier blockers are closed in the code; one small hole remains in the "recipient unavailable" guard and the fix plan covers it (decision: fix)
  • Codex (gpt-6-astra, xhigh): ✅ satisfied — independently verified the remaining recipient bug, the one-line correction and both test extensions; agree with the fix decision and unchanged fix plan

Decision

fix — one condition in the new recipient guard lets a draft with text fall back to another session after an edit; it is a one-line change plus a test extension and a bundle rebuild.

What changes (plain language)

  • What it does: Lets Conversations and Channels see every session, not only the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • Any session can be picked as a recipient or filter, however many the workspace has.
    • Sessions with the same name are told apart: the device name is added, and the session ID when that is still not enough. Offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send; text typed while a send is still in progress is kept.
    • "Open conversation" and the session filter move the composer to that session unless you already have unsent text for someone else.
    • After the remaining fix, if the session a draft was written for disappears, the composer keeps saying "Recipient unavailable — choose a session" until you pick one, including after editing and navigating.
    • Drafts live only in the open page, never in browser storage, and are forgotten on sign-out.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Almost. The developer addressed all six earlier findings and CI is green; five are closed and the recipient guard needs one correction. After "Recipient unavailable" appears, editing the text and then leaving and returning silently points the draft at another session. The fix plan closes that gap.
  • What to expect after merging:
    • The whole session list is re-downloaded each time Conversations or Channels redraws, so load time grows with directory size; performance improvements can be a separate follow-up.
    • A draft with text keeps its recipient even when you open another session's conversation; the "Send to" field shows who it is for.
    • The PR description is out of date: it still says 19 tests, a 50-page limit and device-name-only labels. The developer says the description will be updated at merge.

Findings

Blocking

  1. web/src/app.js:418 — the "recipient unavailable" guard is lost once the draft is edited, so a draft with text can still take another recipient.

    • The guard only fires when the saved recipient is non-empty: restored?.body && restored.to && !sessions.some(...).
    • While the placeholder is selected, the select's value is ''. Any edit of the text (or an inserted attachment reference) runs saveDraft, which stores to: target.value, i.e. to: '' (:420-423).
    • On the next rebuild (tab change, refresh, search, filter), restored.to is falsy, so neither :418 nor :419 applies. The select keeps its default (the open conversation's session, else the first one, :414), the text is restored (:417) and Send is enabled.
    • Repro: write a draft to session A; A disappears (for example its owner is removed from the workspace); refresh → placeholder appears. Edit the text. Go to Tasks and back. "Send to" now shows another session.
    • Impact: this is the misdirected-request case the placeholder was added to prevent. It needs a vanished recipient and an edit before choosing another recipient.
    • Why the extra condition is unnecessary: saveDraft always stores to, and the select's value is '' only while the placeholder is selected, so a draft with text and an empty recipient must retain the unavailable-recipient state.
    • The existing test (web/tests/workspace.spec.js:676-696) covers only the first refresh, not an edit followed by a rebuild. Both reviewers traced the proposed extension through the current code and agree it covers the missing transition.

Non-blocking

  • Repeated directory loading. web/src/app.js:361 and :498 await every directory page before the view paints, and each redraw repeats it. Load time grows with the directory; not measured. Follow-up options: cache per workspace for the page session, or a searchable picker.
  • Late-send redraw is pre-existing. After a send, state.conversationAgent / state.search are set and render() runs unconditionally (:432, :533). If the user switched workspace or signed out meanwhile, that redraws the wrong place or shows an error toast on the sign-in page. Same on main.
  • Upload notice wording. "File uploaded. Copy its reference from Files to share it." (:123) does not say the file is in the workspace where the upload started, which matters after a workspace switch.
  • History labels. Conversation rows and channel authors still use the raw displayName (:363, :500); reusing the composer labels would be consistent.
  • Small simplification. The token objects (:360, :497) could be the plain generation number; ordinary workspace navigation already goes through render().
  • Idempotency key on edit-then-undo. Every edit rotates the key (:423, :525). If an uncertain send actually landed and the user edits and reverts before retrying, it can duplicate. The server deduplicates by key and request hash (bus/store.go:781-790). Unchanged retries across navigation retain their key.
  • Test strength.
    • The older stale-page assertion (web/tests/workspace.spec.js:367-368) can run before the browser could request another page.
    • The "no POST" check in the vanished-session test (:694) runs immediately after the click, so it is weaker evidence than directly asserting the select's invalid state. The browser's required behavior is correct for the inserted first empty option.
    • The late-upload test (:623-652) never returns to workspace 2, so it proves the guard branch ran (via the notice) but does not independently inspect workspace 2's stored draft after another rebuild. The fix plan adds that check.
    • Pending-send preservation is tested for Conversations (:654-674); the equivalent channel/thread guard is verified by reading, not a dedicated delayed-send test. The account test (:461-482) still does not cover signing back into the same account after a pending upload. These are coverage limitations, not additional demonstrated defects.

Fix plan

web/src/app.js

  1. Line 418: remove restored.to && so it reads:

    if (restored?.body && !sessions.some(s => s.id === restored.to)) { target.prepend(el('option', { value: '' }, 'Recipient unavailable — choose a session')); target.value = ''; }

    Line 419 stays as it is.

web/tests/workspace.spec.js

  1. In a draft addressed to a vanished session blocks sending until a new recipient is chosen, append after line 695 (before the closing });):

    await page.getByLabel('Your message', { exact: true }).fill('Hello there, edited');
    await page.getByRole('button', { name: 'Tasks', exact: true }).click();
    await page.getByRole('button', { name: 'Conversations', exact: true }).click();
    await expect(page.getByLabel('Your message', { exact: true })).toHaveValue('Hello there, edited');
    await expect(sendTo).toHaveValue('');
    await sendTo.selectOption('stays-1');
    await page.getByRole('button', { name: 'Send request', exact: true }).click();
    await expect(page.getByText('Hello there, edited', { exact: true })).toBeVisible();
    expect(events.filter(e => e.method === 'POST' && e.path.endsWith('/messages')).at(-1).body.to).toBe('stays-1');

    By code trace, the toHaveValue('') assertion fails on the current head and passes after change 1. The final assertions also check that an explicit valid recipient can still receive the preserved message.

  2. In a late upload never writes into another workspace draft, append after line 651:

    await page.locator('select[aria-label="Workspace"]').selectOption('workspace-2');
    await expect(page.getByLabel('Your message', { exact: true })).toHaveValue('Workspace two text');

    This is test hardening only; it should already pass.

bus/hostedweb/app.js

  1. Regenerate with npm run build in web/ and commit the result; do not hand-edit.

Message to the developer

We tried to apply these fixes ourselves but stopped: Committed fix-plan steps 1-3 as ec44ee3 (web/src/app.js:418 guard no longer requires a non-empty saved recipient; both test extensions added exactly as planned). Step 4 is NOT done: bus/hostedweb/app.js was not regenerated, because web/ has no node_modules and this step forbids installing dependencies and running builds, and the plan forbids hand-editing the bundle. The committed bundle is now stale against the source and still ships the old guard until someone runs npm run build in web/ and commits the result.

Please apply the fix plan.

n/a

Questions for Harsh

n/a

Verification

  • Method: no dependencies were installed and no application build, typecheck, lint, test suite or browser reproduction was run. Findings and expected test outcomes are code traces. Read-only shell/Git/GitHub inspection and documentation lookup were used; git diff --check reported no whitespace errors.

  • Read this round:

    • The PR description, discussion and developer's reply describing 32bc542, plus the current bodies of Workspace UI: make sessions after the first 100 selectable in conversations #183 and Workspace UI: preserve unsent messages and channel replies while navigating #185.
    • The complete authored source/test changes since 21578623594717d3ecc2a2aee067e858282d9dc9, the full base diff of web/src/app.js, and the surrounding current form, authentication, render, message and channel code.
    • All seven new tests (web/tests/workspace.spec.js:557-721) against the fixture, and the older stale-page/account tests cited above.
    • Current server pagination, membership-removal cascades and message idempotency; the build script, package scripts, Playwright configuration and CI job.
    • The generated bundle's unavailable-recipient and detached-upload branches. The same extra truthiness condition is present in the shipped bundle; rebuilding it is necessary after the source correction.
  • Independent check of the fix plan (Codex): editing the placeholder draft saves to: ''; navigating restores its body but currently leaves the select on stays-1. Removing the extra condition restores the empty placeholder instead. Selecting stays-1 then updates the draft normally and the fixture records the intended recipient. Returning to workspace 2 in the upload test checks its saved map entry, not just the already-visible textarea.

  • Browser/test semantics: Playwright documents that fill() triggers an input event, so the proposed edit exercises saveDraft. The HTML standard confirms that selecting the first empty placeholder in this required single-select leaves it invalid. These support the code trace without executing the test. Playwright fill, HTML select validation.

  • Previous six blockers, re-checked against the current code:

    # Earlier problem Now Where
    1 Draft key resolved at access time Closed: key captured before the first await; detached composer never writes web/src/app.js:69, :358, :475, :123
    2 Text-less draft overrode an opened conversation Closed: released on "Open conversation" and on the filter :70, :277, :369
    3 Duplicate labels identical Closed for the reported cases: name-equals-device collapsed, session ID added on collision :85-90
    4 Late completion deleted or overwrote a newer draft Closed: key-matched delete in both submit handlers, plus detached-upload guard :429-431, :530-532, :123
    5 Draft with text took another recipient when its session vanished Partly closed: see the blocking finding :418-419
    6 Silent stop after 50 pages Closed: follows the cursor until no cursor or no new session :75-82
  • Ruleset: the remaining correction completes the existing guard without a compatibility path, migration, dependency or new abstraction. Existing cursor APIs, native form validation and in-memory drafts remain appropriate. No additional architectural change is needed for this fix.

  • Remote evidence:

    • Reconfirmed all 11 checks successful on 32bc542, completed 08:36–08:41 UTC after the commit at 08:36:16 UTC.
    • The workspace-ui job rebuilds the bundle, fails on drift from the committed file and runs the Playwright suite (.github/workflows/ci.yml:171-176). The spec defines 28 tests; the developer also reports 28/28 passing locally. These are remote results, not an audit rerun.
    • The PR reports MERGEABLE/BLOCKED with REVIEW_REQUIRED. Local origin/main and the merge base are both 85d411e77a1c866295f33ed3462cd4d364b2c107.
  • Checks that matter after the fix: in web/: npm ci --ignore-scripts, npm run build, git diff --exit-code -- ../bus/hostedweb against the updated committed bundle, npx --no-install playwright install --with-deps chromium, npm test (28 tests, two of them extended). Then go build ./... and go test ./bus/... for the embedded assets. There are no separate web lint or typecheck scripts. Agreement on the fix plan does not authorize running these during the unresolved audit.

  • Workspace: only the untracked shared AUDIT.md was written. No tracked file changed and no GitHub mutation was performed.

Audit log

  • Round 1, turn 1 (Claude (fable, xhigh)): First audit of 2157862: three blocking defects (lazy draft key, text-less draft overriding "Open conversation", ineffective duplicate labels) and a fix plan. Decision: fix.
  • Round 1, turn 2 (Codex (gpt-6-astra, xhigh)): Confirmed those; added same-draft send/upload races, silent retargeting when a recipient disappears and the 5,000-session cutoff; changed the decision to comment.
  • Round 1, turn 3 (Claude (fable, xhigh)): Accepted all six problems and the comment decision; replaced the requested revision with a smaller exact change list and seven tests.
  • Round 1, turn 4 (Codex (gpt-6-astra, xhigh)): Verified the smaller remedies and agreed; no material changes. The change list was posted to the developer.
  • Round 2, turn 1 (Claude (fable, xhigh)): Audited 32bc542 from scratch. Confirmed five of the six blockers closed and CI green. Found that the unavailable-recipient guard at web/src/app.js:418 requires a non-empty saved recipient, so an edit under the placeholder followed by a rebuild falls back to another session. Wrote a one-line fix, a test extension that fails on the current head, and one test-hardening addition. Decision: fix.
  • Round 2, turn 2 (Codex (gpt-6-astra, xhigh)): Read the new developer reply and changes since 2157862; re-verified draft isolation, guarded completion, recipient selection, labels and complete paging against 32bc542. Confirmed the empty-recipient persistence defect and independently traced both proposed test extensions, including the successful explicit-recipient send. Agreed with the fix decision and unchanged fix plan; clarified completion wording and verification/coverage limits only. No additional blocker, material change, application execution or tracked-source edit.

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

…dits (#199)

The recipient guard no longer requires a non-empty saved recipient, so a
draft edited while the placeholder is selected keeps the unavailable state
across rebuilds instead of falling back to another session. Extends the
vanished-session test with the edit-navigate-reselect transition and hardens
the late-upload test; regenerates bus/hostedweb/app.js with web's own build.
@harshsaver

Copy link
Copy Markdown
Member Author

Pushed fbc8aac applying the round-2 fix plan (all four steps):

  1. web/src/app.js:418 guard no longer requires a non-empty saved recipient.
  2. Vanished-session test extended with the edit-navigate-reselect transition (verified it fails on the old guard: select resolved to stays-1 instead of '').
  3. Late-upload test hardened with the workspace-2 return check.
  4. bus/hostedweb/app.js regenerated with web's own build (npm run build); rebuild verified deterministic (pristine rebuild byte-identical to HEAD bundle).

Local: full web suite 28/28 green. CI run 43496161220: all 11 checks green incl. workspace-ui (bundle-freshness gate + playwright).

@harshsaver harshsaver added the agentbox: ready to merge Audited by Claude and Codex; Harsh can merge label Nov 14, 2026
@harshsaver

Copy link
Copy Markdown
Member Author

🤖 Agentbox PR audit: ready to merge

What this PR changes

  • What it does: Lets Conversations and Channels see every session, not only the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • Any session can be picked as a recipient or filter, however many the workspace has.
    • Sessions with the same name get the device name added, and the session ID when that is still not enough. Offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send; text typed while a send is still in progress is kept.
    • "Open conversation" and the session filter move the composer to that session unless you already have unsent text for someone else.
    • If a draft's recipient disappears, the composer says "Recipient unavailable — choose a session" and will not send until you pick one, including after editing the text and navigating away and back.
    • Drafts live only in the open page, never in browser storage, and are forgotten on sign-out.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Ready. The earlier blocking findings are resolved in the code, browser tests cover the reported flows, and automated checks pass on this exact commit. Some asynchronous variants remain verified by reading rather than dedicated tests, as noted below.
  • What to expect after merging:
    • The whole session list is re-downloaded each time Conversations or Channels redraws, so load time grows with directory size. Performance improvements can be a separate follow-up.
    • A draft with text keeps its recipient even when you open another session's conversation; the "Send to" field shows who it is for.
    • The PR description is still out of date: it says 19 tests, a 50-page limit and device-name-only labels. The developer said it will be updated at merge.
Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 2 turns, commit fbc8aac)

PR audit: #199 — Workspace UI: paginate session directory (#183) and preserve composer drafts (#185)

Head: fbc8aac

Sign-off

  • Claude (fable, xhigh): ✅ satisfied — nothing new on the PR changes the picture; every earlier blocker is closed in the code and CI is green on this exact commit (decision: merge)
  • Codex (gpt-6.1-sol, xhigh): ✅ satisfied — independently verified the latest reply, completed fix plan, source/bundle guard, test extensions and successful CI on this head; no new blocker or material change

Decision

merge — no blocking findings; the round-2 fix plan is applied in full, the bundle matches the source, and all 11 checks pass on this head.

What changes (plain language)

  • What it does: Lets Conversations and Channels see every session, not only the first 100, and keeps an unfinished message while you move around the app.
  • What changes in the product:
    • Any session can be picked as a recipient or filter, however many the workspace has.
    • Sessions with the same name get the device name added, and the session ID when that is still not enough. Offline ones still say "· offline".
    • A half-written message, its recipient and any inserted file reference survive tab changes, refreshes and workspace switches. Each channel and thread keeps its own draft.
    • A draft is cleared only after a successful send; text typed while a send is still in progress is kept.
    • "Open conversation" and the session filter move the composer to that session unless you already have unsent text for someone else.
    • If a draft's recipient disappears, the composer says "Recipient unavailable — choose a session" and will not send until you pick one, including after editing the text and navigating away and back.
    • Drafts live only in the open page, never in browser storage, and are forgotten on sign-out.
  • Why it exists: Workspace UI: make sessions after the first 100 selectable in conversations #183 (sessions after the first 100 could not be messaged from the composer) and Workspace UI: preserve unsent messages and channel replies while navigating #185 (drafts vanished on navigation).
  • Why merge (or why not yet): Ready. The earlier blocking findings are resolved in the code, browser tests cover the reported flows, and automated checks pass on this exact commit. Some asynchronous variants remain verified by reading rather than dedicated tests, as noted below.
  • What to expect after merging:
    • The whole session list is re-downloaded each time Conversations or Channels redraws, so load time grows with directory size. Performance improvements can be a separate follow-up.
    • A draft with text keeps its recipient even when you open another session's conversation; the "Send to" field shows who it is for.
    • The PR description is still out of date: it says 19 tests, a 50-page limit and device-name-only labels. The developer said it will be updated at merge.

Findings

Blocking

None.

Non-blocking

  • Repeated directory loading. web/src/app.js:361 and :498 await every directory page before the view paints, and each redraw repeats it. Load time grows with the directory; not measured. Follow-up options: cache per workspace for the page session, or a searchable picker.
  • Late-send redraw is pre-existing. After a send, state.conversationAgent / state.search are set and render() runs unconditionally (:432, :533). If the user switched workspace or signed out meanwhile, that redraws the wrong place or shows an error toast on the sign-in page. These continuations are unchanged from main.
  • Upload notice wording. "File uploaded. Copy its reference from Files to share it." (:123) does not say the file is in the workspace where the upload started, which matters after a workspace switch.
  • History labels. Conversation rows and channel authors still use the raw displayName (:363, :500); reusing the composer labels would be consistent.
  • Small simplification. The token objects (:360, :497) could be the plain generation number; ordinary workspace navigation already goes through render().
  • Idempotency key on edit-then-undo. Every edit rotates the key (:423, :525). If an uncertain send actually landed and the user edits and reverts before retrying, it can duplicate. The server deduplicates by key and request hash (bus/store.go:781-790); unchanged retries retain their key across navigation.
  • Test strength.
    • The older stale-page assertion (web/tests/workspace.spec.js:367-368) can run before the browser could request another page.
    • The "no POST" check in the vanished-session test (:696) runs immediately after the click, so it leans on the browser's own required blocking. The later assertions explicitly verify that the placeholder survives editing/navigation and that a chosen valid recipient receives the message (:698-706).
    • Pending-send preservation is tested for Conversations (:656-676); the equivalent channel/thread guard (web/src/app.js:530-532) is verified by reading. The account test (web/tests/workspace.spec.js:461-482) does not cover signing back into the same account after a pending upload. These are coverage limitations, not additional demonstrated defects.
  • PR description. Stale, as noted above; cosmetic.

Fix plan

n/a

Message to the developer

n/a

Questions for Harsh

n/a

Verification

  • Local method: read-only code, diff, history, GitHub and CI inspection. No application dependencies were installed; no local build, typecheck, lint, test suite or browser reproduction was run. git diff --check reported no whitespace errors. Remote CI results below are distinguished from local execution.

  • Latest conversation: read the current PR description, discussion, reviews and labels, including the developer's comment at 19:57:07 UTC reporting fbc8aac and all four fix-plan steps. The PR still has no submitted reviews or labels; its description remains stale. The developer's claims were checked against the checkout and CI run. Developer reply.

  • Re-read at this head:

  • Round-2 fix plan is applied in full:

    • web/src/app.js:418 now reads restored?.body && !sessions.some(s => s.id === restored.to). A nonempty draft whose saved recipient is absent or empty keeps the placeholder; editing and rebuilding cannot default it to another session.
    • The shipped bundle carries that same condition immediately before "Recipient unavailable", plus the detached-upload guard.
    • web/tests/workspace.spec.js:652-653 returns to workspace 2 and checks its stored draft. Lines :698-706 cover edit → leave → return → still blocked → choose a recipient → send to that recipient. The spec defines 28 tests.
    • The latest commit changes only that source condition, the two test extensions and the generated bundle.
  • Earlier findings against the current code:

    # Problem State Where
    1 Draft key resolved at access time Closed: captured before loading; detached uploads do not write web/src/app.js:69, :358, :475, :123
    2 Text-less draft overrode an opened conversation Closed: explicit choices release empty drafts :70, :277, :369
    3 Duplicate labels identical Closed for the reported naming configurations :85-90
    4 Late completion deleted or overwrote a newer draft Closed: submitted-key check and detached-upload guard :429-431, :530-532, :123
    5 Draft with text acquired another recipient after disappearance/edit Closed: unavailable and empty recipients retain the placeholder :418-419
    6 Silent stop after 50 pages Closed: follows continuation until completion or no progress :75-82
  • Ruleset: the implementation uses the existing bounded server cursor API and native form controls, keeps draft state in memory, and adds no dependencies, compatibility layers or migrations. The small helpers separate paging, labels and draft identity without a speculative abstraction. No further architectural change is required for correctness; performance is an additive follow-up.

  • Remote evidence independently checked:

    • CI run 43496161220 reports head fbc8aac21a4ec9bffea1256dda2184d3ee320632, status completed, conclusion success.
    • All 11 checks passed, completed 19:52–19:56 UTC after the commit at 19:51:40 UTC.
    • The workspace-ui job's install, build, embedded-asset comparison, Chromium setup and npm test steps all succeeded. The workflow executes those gates at .github/workflows/ci.yml:171-176; this confirms the committed bundle matches the source and the 28-test suite passes in CI.
    • Runtime jobs also passed Go tests, vet and binary builds; the Ubuntu race-test step passed. These checks already ran on the unchanged head and were not duplicated locally during this audit.
    • The PR is open, MERGEABLE/BLOCKED with REVIEW_REQUIRED. Local origin/main and the merge base are both 85d411e77a1c866295f33ed3462cd4d364b2c107.
  • Final checks that matter for this PR: in web/: npm ci --ignore-scripts, npm run build, git diff --exit-code -- ../bus/hostedweb, npx --no-install playwright install --with-deps chromium, npm test (28 tests). Then go build ./... and go test ./bus/... for the embedded assets. There are no separate web lint or typecheck scripts. The merge decision depends on successful checks for the commit being merged; the current head has successful CI evidence.

  • Workspace: only the untracked shared AUDIT.md was written. No tracked file changed and no GitHub mutation was performed.

Audit log

  • Round 1, turn 1 (Claude (fable, xhigh)): First audit of 2157862: three blocking defects (lazy draft key, text-less draft overriding "Open conversation", ineffective duplicate labels) and a fix plan. Decision: fix.
  • Round 1, turn 2 (Codex (gpt-6-astra, xhigh)): Confirmed those; added same-draft send/upload races, silent retargeting when a recipient disappears and the 5,000-session cutoff; changed the decision to comment.
  • Round 1, turn 3 (Claude (fable, xhigh)): Accepted all six problems and the comment decision; replaced the requested revision with a smaller exact change list and seven tests.
  • Round 1, turn 4 (Codex (gpt-6-astra, xhigh)): Verified the smaller remedies and agreed; no material changes. The change list was posted to the developer.
  • Round 2, turn 1 (Claude (fable, xhigh)): Audited 32bc542 from scratch. Five of six blockers closed; found the unavailable-recipient guard at web/src/app.js:418 was lost after an edit. Wrote a one-line fix and two test extensions. Decision: fix.
  • Round 2, turn 2 (Codex (gpt-6-astra, xhigh)): Confirmed the defect and traced both test extensions; agreed with the fix decision and unchanged plan.
  • Round 2, fix step (Claude (fable, xhigh)): Applied the source and test changes locally but could not regenerate the bundle (no installs or builds allowed in that step), so the plan went back to the developer.
  • Round 3, turn 1 (Claude (fable, xhigh)): Audited fbc8aac. The developer's commit matches the fix plan line for line, the bundle is regenerated with the corrected guard, and CI is green on this head. No new blocker. Decision: merge.
  • Round 4, turn 1 (Claude (fable, xhigh)): Same head, fresh checkout. Read the PR conversation: the only new item is the developer's comment reporting fbc8aac; no reviews, labels or description edits. Re-checked the guard in source and bundle, the two test extensions, the CI run's head SHA and main's position. Nothing changed. Decision: merge.
  • Round 4, turn 2, resumed (Codex (gpt-6.1-sol, xhigh)): Verified the fresh fbc8aac checkout, latest developer reply, full authored source/test diff, round-2 fix, generated guard, test extensions and CI run/step results. Re-checked all six earlier findings and the remaining non-blocking notes. Agreed with merge; refined coverage wording and verification evidence only. No new blocker, material change, local application execution or tracked-source edit.

Final checks (run once, after both agents agreed)

web: npm ci --ignore-scripts — PASS; 0 vulnerabilities
web: node --check src/app.js, tests/workspace.spec.js and build.mjs — PASS
web: npm run build — PASS
web: git diff --exit-code -- ../bus/hostedweb — PASS; generated assets match
web: npx --no-install playwright install chromium — PASS
web: npm test — PASS; 28/28 tests on headless Linux arm64
web: separate typecheck/lint — not configured in package.json
Go: go build ./... — PASS
Go: go test ./bus/... — PASS
Go: go vet ./... — PASS
Tracked-file verification — PASS; original checkout and isolated worktree unchanged
Logs/artifacts: /home/harshsaver/pr199-final-checks.tncrVX

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

@harshsaver
harshsaver merged commit fb965f7 into main Nov 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentbox: ready to merge Audited by Claude and Codex; Harsh can merge

Projects

None yet

1 participant