Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(workforce): narrow hiredSeatManifest's problem case at the #2079 …
…call sites

main has been red since ffe2b6e. #2091 (FIX-1529) changed hiredSeatManifest
to return `{ manifest } | RowProblem`; #2079 (seat-hire catalog tools),
merged minutes later, added two call sites that read `.manifest` without
narrowing, so @flow-state-dev/workforce no longer compiles.

Both now handle the problem case the way roster/reload.ts already does:
- manifest-sources: a row owned by another org is skipped when listing
  seats, alongside the unparseable-row skip on the line above.
- seat-hire-capability: the hire refuses with the row's reason.

Verified: the workforce build fails on main with exactly CI's four TS2339
errors and passes with this change; workforce 755/755; pnpm typecheck
70/70.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Zc4qjodAcrYK5kMfcrXS8
(cherry picked from commit db41f92)
  • Loading branch information
claude committed Sep 23, 2026
commit d32efe04bd43d1cafd72a165d9ca6dd58e4d264b
1 change: 1 addition & 0 deletions packages/workforce/src/manifest-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ function seatsSource(
const parsed = parseHiredSeatRow(stored.state);
if ("problem" in parsed) continue;
const record = hiredSeatManifest(orgId, parsed.row);
if ("problem" in record) continue;
if (!declared.has(record.manifest.id)) {
declared.set(record.manifest.id, record.manifest);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/workforce/src/seat-hire-capability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export function createSeatHireCapability(
instructions: input.instructions ?? null,
});
const record = hiredSeatManifest(orgId, row);
if ("problem" in record) {
throw new Error(`"${address}" could not be hired: ${record.problem}.`);
}
const [seat] = hireWorkforce([record.manifest], {
kinds,
channelBoards: options.channelBoards,
Expand Down