Commit 6365906
authored
refactor(director): resolve provider and fleet state without host closures (#1044)
* feat(director): resolve getProviderId and getLiveFleetCount without host closures (CL-7918)
Decision record:
- getProviderId -> reactor-supplied. Retry stamping needs the live source
id so mid-session /model switches remap (xAI bare-429 retry vs abort).
Neither static config (loses remap liveness) nor BaseEnv.sources
(carries definitions, not the live selected id) suffice. The director
now seeds from options.provider.providerName and refreshes the stamped
id from each inference completion's source.sourceId; BaseEnv.sources
remains the fallback only until the first completion stamps it.
- getLiveFleetCount -> static config allowIdleWithFleet (default false).
Live counts only ever gated one boolean (non-zero allows terminal
wait/reply with open tasks); the exact count was never consumed.
Rejected: BaseEnv-derived (no fleet state there) and reactor-supplied
(the reactor owns no fleet-lane registry; a live count closure just
re-adds the host hook this lane removes). TUI chat sets
allowIdleWithFleet: true (fleet lanes may appear mid-session); exec and
the default keep the historical nudge-while-open behavior. Static true
is strictly more permissive than the old count>0 gate once a fleet
lane drains, which is the safe direction for terminal wait.
Both closures removed from ChatDirectorOptions. No new env key.
Mid-session /model remap and idle-with-fleet behavior covered by
src/director.test.ts (remap abort->retry across a source switch;
idle-with-fleet terminal wait without nudge spend).
* fix(director): ignore empty source ids in live source tracking (#1056)
* fix(director): ignore empty source ids in live source tracking
An empty-string source id on a completion or cycle source no longer clobbers the learned source id used to stamp retry decisions.
* docs(director): align cycle-source comment with override precedence (#1057)
* feat(director): liven idle-with-fleet flag and decouple host from workflow seam typing (#1048)
* feat(director): liven idle-with-fleet flag and decouple host from workflow seam typing
Summary: optionalize the host-to-runtime workflow seam so the host degrades gracefully against directors without workflow support; replace the static idle-with-fleet seed with a live narrow setter driven by fleet-wake publisher transitions. Verification: bun run check passes (7393 tests, 0 fail).
* fix(tui): re-sync idle-with-fleet flag on director rebuilds (#1058)1 parent 71d9052 commit 6365906
11 files changed
Lines changed: 621 additions & 67 deletions
File tree
- src
- agent
- session
- tui/runner
- workflows
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
440 | 458 | | |
441 | | - | |
442 | 459 | | |
443 | 460 | | |
444 | 461 | | |
445 | | - | |
446 | | - | |
447 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
448 | 468 | | |
449 | | - | |
| 469 | + | |
450 | 470 | | |
451 | 471 | | |
452 | 472 | | |
| |||
455 | 475 | | |
456 | 476 | | |
457 | 477 | | |
| 478 | + | |
| 479 | + | |
458 | 480 | | |
459 | 481 | | |
460 | 482 | | |
| |||
489 | 511 | | |
490 | 512 | | |
491 | 513 | | |
492 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
493 | 521 | | |
494 | 522 | | |
495 | 523 | | |
| |||
536 | 564 | | |
537 | 565 | | |
538 | 566 | | |
539 | | - | |
540 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
541 | 576 | | |
542 | 577 | | |
543 | 578 | | |
544 | 579 | | |
545 | 580 | | |
546 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
547 | 589 | | |
548 | 590 | | |
549 | 591 | | |
| |||
951 | 993 | | |
952 | 994 | | |
953 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
954 | 1006 | | |
955 | 1007 | | |
956 | 1008 | | |
| |||
1051 | 1103 | | |
1052 | 1104 | | |
1053 | 1105 | | |
1054 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1055 | 1111 | | |
1056 | 1112 | | |
1057 | 1113 | | |
| |||
1086 | 1142 | | |
1087 | 1143 | | |
1088 | 1144 | | |
1089 | | - | |
| 1145 | + | |
1090 | 1146 | | |
1091 | 1147 | | |
1092 | 1148 | | |
1093 | 1149 | | |
1094 | 1150 | | |
1095 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1096 | 1156 | | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
1108 | 1160 | | |
1109 | 1161 | | |
1110 | 1162 | | |
| |||
1129 | 1181 | | |
1130 | 1182 | | |
1131 | 1183 | | |
| 1184 | + | |
1132 | 1185 | | |
1133 | 1186 | | |
1134 | 1187 | | |
| |||
0 commit comments