Skip to content

FIX-2412: the roster follows hires, forks, edits and fires in every app - #4747

Merged
jhoffner merged 7 commits into
mainfrom
claude/project-thread-uxpn8e
Nov 5, 2026
Merged

jhoffner merged 7 commits into
mainfrom
claude/project-thread-uxpn8e

Conversation

@jhoffner

@jhoffner jhoffner commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Requested by Jake · project thread

The problem

Three apps show a user's workers: Kitchen Sink, Shift Manager and the Teammates lab. Each one read the roster once. A worker hired, forked, edited or fired in another tab, or by a worker's own turn, did not appear until a reload or a Retry. Shift Manager's DELEGATES picker did not show it until the screen remounted. A hire looked like it had failed.

Kitchen Sink's rail also kept its coordinators in a hand-written list (SHELL_COORDINATORS). A second coordinator WORKER.md stayed off the rail, and a test failed, until someone edited that list.

What this does

  • The workforce client gets one new method, watchRoster(onRoster, { onError }), on @flow-state-dev/workforce/browser. It reads the roster, and reads it again when the client's subscribe hears a change under either worker collection on the user's topic. Where push can miss a change, the client's own fallback timer reads every 3 s. The views keep no timer of their own.
  • Kitchen Sink's Workers panel, Shift Manager's roster (Roster, TEAMS, a project's lead picker, worker settings and DELEGATES, on one watch per connection) and the Teammates list all follow that watch. Each app's one-shot read is gone, and so is Kitchen Sink's Retry.
  • Kitchen Sink's rail reads the roster at each listing and lists every worker on the coordinator flow. SHELL_COORDINATORS and its test case are gone.

The goal check goals/realtime/roster-follows-hires/ passes: each view shows a hire, a fork, an edit, a fire and a no-stream hire within 1 s (slowest 24 ms), makes 0 roster reads over 10 s idle, and another user's views read nothing. Each of its three controls fails where it must.

What's asked of you

This implements the approved direction (D1 and D2 as recommended: no existing-conversation flag on a roster row). Nothing new is yours to decide.

Parts worth reviewing closely

  • packages/workforce/src/workers/client.ts → rosterMayHaveChanged. Is the path match right? It reads on a resource notice under workforce/workers/ or workforce/standard-workers/, on one with no path, on resync, and on null. A false no leaves every app's roster stale; a false yes costs one read.
  • packages/shift-manager/src/lib/roster.ts → joinWatch. One watch per Lab connection, shared by every view and stopped by the last one. useRoster keys the watch on the connection's client only and holds the workforce client in a ref, because a test double (or a careless caller) that hands back a new workforce client on each render would otherwise restart the watch in a loop. Is the ref the right call, or should the hook depend on the workforce client too?
  • labs/teammates/src/App.tsx. The boot now rides the watch: the first roster lands the page, later ones redraw the list. After this tab's own hire, the new row arrives through the watch, so the new teammate opens when its row lands, not before.
  • .changeset/roster-watch.md. WorkforceClientSource now includes subscribe. A client from createClient has it; a hand-built source does not. The changeset calls this breaking for a hand-built source. Is minor right?

Spec specs/issues/FIX-2412/ (spec PR #4733, merged) · Linear FIX-2412 · epic FIX-2369.

How to review this — altitude, what's in scope, what's deliberately unsettled

How to review this. This implements an approved spec — the approach and the numbered decisions in its DECISIONS.md are already signed off by a human, so please review the code against that direction, not the direction itself. The canonical set is retained at specs/issues/FIX-2412/ on main; Linear links to it and the original merged spec PR, which keeps review history. Follow-up amendment PRs explain later direction changes. Current architecture docs remain the authority for shipped behavior (BP-037).

Most valuable here: correctness on the second path (the legacy shape, the null boundary, the concurrent case, the cancel path), anything deriving an auth or routing decision from caller-controllable input, and a behaviour the tests assert around rather than on.

Already settled upstream: the approach and every decision in the spec's DECISIONS.md (human-approved — if one is wrong, say so as a spec finding and it gets folded back; don't re-argue it inline), and the conventions in docs/contributing/best-practices.md.

Engineering calls — decided along the way, no product sign-off needed
  • The rail is not on the watch. It reads the roster at each listing, as the spec's "Decided, not asked" says; when the listing re-runs is FIX-2411's. The goal states that a:within-1s covers the Workers panel, and d:rail covers what the rail lists. If wrong: the rail and the panel disagree until the rail lists again.
  • A failed read keeps what is drawn. In Shift Manager, a failed re-read keeps the roster on screen; only a failure before the first read shows. In Kitchen Sink, the alert shows only until the first roster lands. The watch does not retry a failed read on a timer of its own with the socket up; the next notice or reconnect reads again. If wrong: a transient failure on first load stays on screen until the next change.
  • Teammates verb. LabAdapter.listWorkers became watchWorkers(onChange, onError), beside the other watch* verbs (FIX-2466). The fake lab follows it. Retry starts a new watch.
  • DELEGATES does not re-read the delegates on a roster change (FIX-2409's note: a delegates read writes a request on the conversation, which its snapshot hears). Only the picker's roster comes from the watch.
  • Coalescer copy. coalesced in the workforce client is a third copy of react's internal coalescedReads, as the spec's debt table accepts; FIX-2551 lifts one into the client. Lifting it here would widen this PR into client API changes.
  • Docs written in this session. No separate docs-writer pass ran (no sub-agent dispatch was available). The new prose is durable-hire.md → Keep the roster current, one line in ui.md, the workforce README's client paragraph and example, Shift Manager's Roster paragraph and the Teammates read table.
Everything else — verification, red states, the spec checker, files

Goal check (cd goals && pnpm tsx realtime/roster-follows-hires/run.mts):

  • PASS: a: 3 views × 5 changes shown, slowest 24 ms after the change completed; 0 roster reads over 10 s idle in each of 3 views · b: bob's 3 views read 0 times and never showed alice's workers · c: no push, the hire shown in 1529/1530/1514 ms · d: the rail listed support.desk and support.help.
  • GOAL_CONTROL=read-once: FAIL a:within-1s (all 15 never shown) and c:no-push (3 views never); a:quiet, b, d held.
  • GOAL_CONTROL=hand-list: FAIL d:rail only (listed ["support.help"]).
  • GOAL_CONTROL=timer: FAIL a:quiet (4 reads per view over 10 s idle) and b:other-user (4 reads per bob view); the rest held.
  • Not shown failing: b's "never shows alice's workers" half. The server scopes the read to its caller, and no app-side patch can break that.

Unit tests and red states

  • packages/workforce/test/watch-roster.test.ts (5 cases), red before the method existed. Blast radius, one perturbation each: match every path, no coalescing, keep the last roster after a failure, another pace, report after stop. Each reddened exactly its own case and nothing else.
  • Kitchen Sink test/team-panel.test.tsx and test/rail-sessions.test.ts: red against the previous panel and the hand list (5 of 6 cases failed for the intended reason).
  • Shift Manager test/roster-screen.test.tsx (one watch per connection; a hire reaches Roster and TEAMS with no new snapshot) and test/coordinator-view.test.tsx (DELEGATES offers a hire with no delegates re-read): red against the previous sources. Removing the per-connection sharing reddens the one-watch case only.
  • Teammates test/roster-follows.test.tsx: making the App ignore every roster after the first reddens both cases, and the four existing hire/fire cases too.

The spec's checker (specs/issues/FIX-2412/poc/roster-reads/check.mjs) exits 1 after this change, as expected for spec-time evidence: the 9 moved and 1 removed sites are now MISSING, the 3 "stays" sites are still found, and one new site, the rail's roster() read at each listing, is unclassified. That read is the one the spec decided.

Files

  • packages/workforce: watchRoster on the client; WorkforceClientSource adds subscribe; test; README.
  • apps/kitchen-sink: TeamPanel on the watch, Retry removed; the rail reads coordinators off the roster; SHELL_COORDINATORS and its test case removed; tests.
  • packages/shift-manager: useRoster on one shared watch per connection (no readAt); DELEGATES uses useRoster; test doubles gain watchRoster; README Roster paragraph.
  • labs/teammates: watchWorkers replaces listWorkers; the App boots on the watch and drops its re-reads after hire and fire; fake lab; tests; README.
  • goals/realtime/roster-follows-hires/: the goal and its three controls.
  • apps/docs: durable-hire.md, ui.md.
  • .changeset/roster-watch.md: workforce minor, shift-manager patch.

The snapshot's own roster read in packages/shift-manager/src/lib/reads.ts stays (FIX-2409).


Generated by Claude Code

…ager and Teammates (FIX-2412)

- workforce: WorkforceClient.watchRoster(onRoster, { onError }) on the browser
  entry, built on client.subscribe (user topic, both worker collections'
  paths, the client's fallback timer only). WorkforceClientSource adds subscribe.
- kitchen-sink: TeamPanel follows the watch (Retry gone); the rail reads its
  coordinators off the roster's flows; SHELL_COORDINATORS removed.
- shift-manager: useRoster is one shared watch per connection; DELEGATES
  picks from it without re-reading the delegates.
- teammates: LabAdapter.watchWorkers replaces listWorkers; the App boots on
  the watch and drops its re-reads after hire and fire.
- goal: realtime/roster-follows-hires with read-once, hand-list and timer controls.
- docs: durable-hire, ui, workforce and shift-manager READMEs, Teammates table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGg5ZaksUKbmqvc8F8
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flow-state-dev-build-site Ready Ready Preview Nov 5, 2026 5:37pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Nov 5, 2026 5:37pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Nov 5, 2026 5:37pm UTC
flow-state-dev-ui Ignored Ignored Preview Nov 5, 2026 5:37pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

FIX-2412

@jhoffner jhoffner self-assigned this Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T01:00:55.248655Z 5bc8478 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jhoffner

jhoffner commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

jhoffner commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass

Reviewed against the approved direction (D1/D2), so none of this re-argues the spec. Overall the shape is right: one push-driven method on the workforce client, apps drop their own reads and timers. The goal check and the red-state evidence are solid. Findings, most important first.

1. Teammates: a failed openConversation strands the roster (correctness, second path)

labs/teammates/src/App.tsx (the watchWorkers callback). watchRoster records the roster as last and reports it once. The App then runs Promise.all(openConversation…), and if that rejects, failed only sets unreachable before the first landing. After landing, the error is swallowed, workers and sessions are not updated, and watchRoster will not report an identical roster again. The list stays stale until the roster next changes. That is the failure this PR exists to remove, reached through a different door.

  • Suggest: after landing, surface the failure the way Shift Manager keeps the drawn roster and shows something, or retry the open on the next notice. A test for "second roster, openConversation rejects, then a later notice" would pin it. None of the listed red states cover it.

2. Teammates: hire loses focus and selection timing (regression)

hire still calls selectWorker(hired.id) before the row exists. selectWorker reads conversations.current[id], which is still unset, so focusComposer is skipped. Previously loadRoster() ran first, so the cursor landed in the new teammate's composer. Meanwhile selected points at an id absent from teammates for a moment. The PR text says the teammate "opens when its row lands", but the focus half is not replayed when it does.

  • Suggest: remember the hired id and run select/focus in the watch callback once byWorker[id] is present, instead of selecting ahead of the row.

3. Teammates: fire picks the next selection from a stale closure

setSelected(workers.find((w) => !w.takesTasks && w.id !== worker)?.id) uses workers from the render that created fire. A hire or fire from another tab that already landed is fine, but one landing between the click and the await is not seen, and the pick can name a worker the watch has just removed. Prefer deriving "next teammate" when the roster lands (selection falls back if selected is no longer in talking). That also covers a fire made in another tab, which today leaves selected on a worker that is gone. This is the new capability the PR adds, so it needs the same treatment.

4. useRoster: the ref is acceptable, but the stated reason is test-only

In packages/shift-manager/src/lib/roster.ts, useWorkforce() is useMemo(() => createWorkforceClient(client), [client]), so in production it can never differ from client. The ref only protects against a test double or caller that returns a fresh client per render. Two consequences worth a line in the doc comment:

  • The shared watch (WeakMap keyed on client) permanently binds to whichever workforce client created it. If useWorkforce ever gains another input (e.g. user), the watch would silently stay on the first. Keying on the workforce client, or asserting equality, would be safer. The ref is OK as is; I'd keep it and fix the double instead of the hook if it is cheap.
  • useState(() => watches.get(client)?.read) plus view(held.read) in joinWatch calls setRead with the same value on mount. It is harmless, but a reader will wonder which one is the source of truth.

5. Duplicated reads on start (small, measurable)

watchRoster calls reads.request() after subscribe, and the hub also calls onChange(null) on connect. Coalescing caps it at two reads, but the first-load path likely costs a second roster read each time. If the goal's idle count allows it, drop the explicit initial request when subscribe is guaranteed to fire a null on connect, or note why both are needed (push unavailable ⇒ does the hub still fire null?). Worth confirming rather than assuming.

6. Architecture observations (take only where this PR is already touching)

  • Three hand-written "watch → state" glue blocks now exist: Kitchen Sink useRoster, Teammates watchWorkers+App effect, Shift Manager joinWatch. They differ on failure semantics (KS keeps the last roster but shows an alert until first landing; SM keeps the roster and drops errors; Teammates swallows after landing). The PR's engineering call says "a failed read keeps what is drawn", yet Teammates doesn't match it (see 1). One shared rule, written once next to watchRoster (for example onError only fires before the first success), would remove the divergence without a new package surface. A hook can't live in workforce or react because of the package boundaries, so I would not try to extract one here.
  • coalesced copy is acknowledged and tracked by FIX-2551. Fine to leave; add the issue id to the comment as a TODO(FIX-2551) so the third copy is greppable.
  • ROSTER_PREFIXES derives the second prefix with STANDARD_WORKERS_PATTERN.slice(0, -1). This works only while the pattern ends in *. Export a STANDARD_WORKERS_PREFIX from keys.ts beside WORKERS_PREFIX instead of slicing. This is a two-line tidy that this PR already motivated.
  • Rail: reading roster() at each listing and then ensureWorkerSession per coordinator is correct and removes the hand list. It does add one roster read per listing; fine given the spec's decision, but it should stay out of any hot loop FIX-2411 introduces. Worth a note on FIX-2411.

7. Changeset

WorkforceClientSource gaining a required subscribe is a type-level break for hand-built sources. Pre-1.0, minor is the right bump per BP-022 (patch/minor only); the changeset text calling it out is the right amount.

8. Test gaps

  • rosterMayHaveChanged has no negative case in the listed red states beyond "match every path": a resource notice under an unrelated path (e.g. a session's resource) should be asserted not to read.
  • Nothing asserts that onRoster stays silent when the roster is unchanged after a null tick (the 3 s fallback), which is what keeps the idle views from redrawing.

Not flagged

rosterMayHaveChanged path match looks right: path === undefined, resync and null all read, and a resource notice under the two prefixes reads. Order of keys in JSON.stringify is stable because entries come from one mapping.


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Snob — already tight. No POC.

Head 03069691bd07e291f6e58ff773dc8276bf835bcc. I read packages/workforce/src/workers/client.ts (watchRoster, rosterMayHaveChanged, coalesced), packages/react/src/internal/coalescedReads.ts, packages/shift-manager/src/lib/roster.ts and workforce.ts, packages/shift-manager/src/components/DelegatesPanel.tsx, apps/kitchen-sink/components/team-panel.tsx, apps/kitchen-sink/lib/rail-sessions.ts, labs/teammates/src/App.tsx, labs/teammates/src/adapter.ts, labs/teammates/test/fake-lab.ts, and goals/realtime/roster-follows-hires/run.mts.

A rewrite would not shrink the contract:

  • coalesced is the recorded copy of coalescedReads until FIX-2551. Inlining it, or importing the react internal, is the split this PR left filed.
  • joinWatch is the one watch per connection. useWorkforce is memoized on the client. roster-screen.test.tsx returns a new workforce object on each render, and the ref is what keeps that from restarting the watch. Dropping the ref moves that constraint onto every caller. The view set stays, because a listener can leave during tell.
  • Kitchen Sink's useRoster is the one effect. The rail's roster() filter is what replaced SHELL_COORDINATORS. The rail stays off the watch.
  • The Teammates boot effect is the first roster landing the page and later rosters redrawing the list. failureOf is the 502 the connection screen shows. The fake's stringify skips conversation notifies that leave the roster the same; without it every message opens every conversation again.
  • The goal file mounts three surfaces (panel rows, useRoster, watchWorkers) and patches three controls. A shared grader still walks those three views.

The changeset, durable-hire.md, and the workforce README are the public method. Cutting the comments leaves the same code.

Fold nothing. D1, D2, the rail, DELEGATES, and the coalescer copy stay as recorded.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03069691bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread labs/teammates/src/App.tsx Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Simplify / architecture

Problem: Roster UIs in Kitchen Sink, Shift Manager, and Teammates stayed on one-shot roster() reads, so hires/forks/edits/fires from another tab or a worker turn did not show up without reload/retry.

Verdict: The chosen shape matches FIX-2412 D1 and is simpler than the main alternatives (each app re-implementing subscribe + path matching, or adopting React's live Roster panel on a different collection). Centralizing watchRoster on @flow-state-dev/workforce and keeping app code thin (Teammates delegate, KS useEffect, SM shared watch) is the right local minimum.

I do not think the PR over-engineered the core primitive. The extra complexity that looks heavy is mostly Shift Manager's WeakMap refcount — that is package-local, solves real multi-surface + dual first-read roster-session races, and is appropriate there. Kitchen Sink's inline hook is fine for a single panel today.

What I'd treat as follow-up (not blockers):

Item Note
FIX-2551 coalesced in workforce duplicates react's coalescedReads — already accepted in spec; merge when that issue lands.
Second watchRoster on one client Spec calls this a review finding; keep one watch per connection (SM pattern) if KS grows more roster surfaces.
JSON.stringify dedup Saves callbacks, not I/O; fine at current roster sizes.
Rail railSessions Still one-shot roster() per coordinator listing — intentional per goal (live rail is FIX-2411).
Goal driver ~456 lines High-value cross-app proof; optional split into host/mount/assert modules if it churns often.

Alternatives considered (and why I wouldn't pivot this PR):

  • useSubscription in React only — doesn't help Teammates/goal driver; still need workforce path knowledge.
  • SWR/React Query — fights the locked client.subscribe + single fallback timer model (FIX-2428).
  • Shared @flow-state-dev/workforce/react hook — nice DX later; not required to ship FIX-2412.

Verification: pnpm --filter @flow-state-dev/workforce test (includes watch-roster.test.ts) — 1783 tests passed on this branch.

Approving directionally; inline notes are nits and guardrails for follow-ups.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

* queues exactly one more. A copy of react's internal `coalescedReads`,
* until FIX-2551 lifts one into the client.
*/
function coalesced(read: () => Promise<void>): { request: () => void; close: () => void } {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Accepted debt per D1/FIX-2551 — this mirrors packages/react/src/internal/coalescedReads.ts. When FIX-2551 lands, delete this copy and import the shared helper so workforce + react + lab adapters do not drift.

const reads = coalesced(async () => {
try {
const entries = await client.roster();
const seen = JSON.stringify(entries);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dedup runs after a full roster() round-trip — correct trade today. If bare user resource notices get noisy in production, tighten rosterMayHaveChanged rather than skipping coalesce (spec prefers false-positive reads over staleness).

const reads = new WeakMap<object, { readAt: number; read: Promise<RosterEntry[]> }>();
const watches = new WeakMap<object, SharedWatch>();

function joinWatch(client: object, workforce: WorkforceClient, view: (read: RosterRead) => void): () => void {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Refcounted shared watch is the heaviest glue here but justified for many SM surfaces + avoiding dual first-read roster-session races. Consider a one-line module invariant: WeakMap key = Lab client identity; last subscriber stops watchRoster.

}

/** The user's roster as the workforce client's watch reports it, and the last read's failure until one lands. */
function useRoster(workforce: WorkforceClient): {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Name collision with Shift Manager's exported useRoster(). Fine for one panel; if KS adds another roster consumer, use SM's shared-watch pattern — D1 treats a second watchRoster on the same client as a review finding.

const list: RailClient["sessions"]["list"] = async (options) => {
const flow = options?.flowKind;
if (flow === undefined || !isCoordinatorFlow(flow)) return await client.sessions.list(options);
const coordinators = (await workforce.roster()).filter((worker) => isCoordinatorFlow(worker.flow));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Live watch on the panel; one-shot roster() here for coordinator listing is intentional (goal leg d; live rail is FIX-2411). A FIX-2411 pointer comment would help the next reader.

…ammates roster

After the page lands, each roster change applies even when one teammate's
conversation fails to open; that teammate keeps the conversation it had, or
opens it when picked. Before landing, a failed open still shows the
unreachable screen with Retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGg5ZaksUKbmqvc8F8
@jhoffner

jhoffner commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Architect: not approving yet. Two second-look findings in labs/teammates/src/App.tsx have no fix or reply at 34b79da6: hire (line 131) still calls selectWorker(hired.id) before the row lands, so the new teammate's composer no longer gets focus, and fire (line 135) picks the next selection from a stale workers closure. Fix both (select and focus once the hired row lands; fall back from the landed roster) or decline each with a reason, and this unblocks.

— FSD Architect

…hat lands

A hire selects its teammate, with the cursor in its composer, once the row and
its conversation land; a fire picks the next teammate from the roster that no
longer lists the fired one, never from the list drawn before the call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGg5ZaksUKbmqvc8F8

jhoffner commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Both are fixed in 5bc8478.

  • hire: the pick now waits for the roster. Once the hired row and its conversation land, the teammate is selected and its composer gets focus. If the row has already landed by the time the hire returns, it is picked right away. A new test in roster-follows.test.tsx hires through the form and checks that the cursor lands in the new teammate's composer. It fails at 34b79da6.
  • fire: the next selection now comes from the first landed roster that no longer lists the fired teammate, not from the workers list drawn before the call. I don't have a red test for this one. In the fixture, the first teammate is always one from the files, and those can't be fired, so the old list and the landed list pick the same teammate. The existing screen test still covers the fire flow end to end.

Teammates: typecheck is clean and 187/187 tests pass.


Generated by Claude Code

…-uxpn8e

# Conflicts:
#	apps/kitchen-sink/lib/rail-sessions.ts
#	apps/kitchen-sink/test/rail-sessions.test.ts
…-uxpn8e

# Conflicts:
#	apps/kitchen-sink/lib/rail-sessions.ts
…-uxpn8e

# Conflicts:
#	labs/teammates/src/App.tsx
#	labs/teammates/src/adapter.ts
#	labs/teammates/test/fake-lab.ts
auto-merge was automatically disabled November 5, 2026 17:36

Head branch was pushed to by a user without write access

@jhoffner
jhoffner added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 335b846 Nov 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants