@cohortapp/agent-sdk 2.18.27 → 2.18.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -250,6 +250,14 @@ export function sessionArgs(i = {}) {
250
250
  * @param {{model: string}} i - the lane input.
251
251
  * @returns {string[]} the claude argv.
252
252
  */
253
+ /**
254
+ * The output style a daemon-spawned seat session runs in. "default" is Claude
255
+ * Code's own plain style — no decorative teaching blocks, and no instruction to
256
+ * hand work back to the reader. Overridable for an operator who genuinely wants
257
+ * a different one on their seat's sessions.
258
+ */
259
+ const SEAT_OUTPUT_STYLE = process.env.MAESTRO_SEAT_OUTPUT_STYLE || "default";
260
+
253
261
  const TEXT_ONLY_ARGV = (i) => ["--print", "--model", i.model, "--strict-mcp-config", "--tools", ""];
254
262
 
255
263
  const LANES = Object.freeze({
@@ -460,11 +468,51 @@ export function buildSpawn(i = {}, deps = {}) {
460
468
  if (!envResult.ok) return fail(envResult.error.code, envResult.error.message);
461
469
 
462
470
  const perm = Array.isArray(i.permissions) ? i.permissions : (spec.defaultPermissions || []);
463
- // Path B: a cohort-llm retarget authenticates through the seat-token helper,
464
- // which Claude Code only reads from settings (child-env COHORT_HELPER_KEY).
465
- const settings = envResult.retargeting && isCohortHelperRetarget(i.retarget)
466
- ? ["--settings", JSON.stringify({ apiKeyHelper: i.retarget[COHORT_HELPER_KEY] })]
467
- : [];
471
+ // A SEAT SESSION PINS ITS OWN OUTPUT STYLE.
472
+ //
473
+ // A seat writes to colleagues in a room, not to a developer at a terminal, so
474
+ // a teaching output style is wrong for it. `scripts/setup/init-agent.sh` used
475
+ // to enable explanatory-output-style and learning-output-style on every
476
+ // provisioned machine (fixed in 2.18.28), and enabling the plugin is what
477
+ // turns the style ON — so a seat ran in "learning" mode with no `outputStyle`
478
+ // key anywhere. Observed 2026-09-30 20:12:55Z: a seat posted a decorative
479
+ // teaching block, box-drawing rules and all, into a shared engineering
480
+ // channel mid status message. The learning style is worse in kind: it
481
+ // instructs the model to stop and ask the reader to write the code.
482
+ //
483
+ // Pinning it HERE rather than editing the machine is the point. The flags live
484
+ // in the operator's own global settings file, which also governs their
485
+ // interactive terminal; an upgrade has no business rewriting that, and an
486
+ // operator who wants explanatory mode for their own sessions keeps it. This
487
+ // only constrains sessions the daemon spawns.
488
+ //
489
+ // WHY THIS IS SAFE, ESTABLISHED RATHER THAN ASSUMED. `--settings` is documented
490
+ // as loading "additional settings", i.e. it MERGES into the precedence chain
491
+ // rather than replacing it — and the CLI distinguishes the two cases, since
492
+ // `--strict-mcp-config` exists precisely to make MCP config exclusive and
493
+ // `--settings` has no such counterpart. Verified live: a `--print` run carrying
494
+ // `--settings '{"outputStyle":"default"}'` exited 0 AND still fired the
495
+ // SessionEnd hook defined only in the machine's global settings, which proves
496
+ // the global file was still in effect. Had it replaced instead, passing this
497
+ // unconditionally would have stripped every seat's permissions and silenced
498
+ // the fleet, which is why it was not shipped on the documentation alone.
499
+ //
500
+ // Reaches the three lanes whose argv carries `x.settings` — dispatcher, resume
501
+ // and cadence — which are the full work sessions, and the dispatcher lane is
502
+ // the one whose end-of-turn text the silent-success rescue republishes. The
503
+ // short-text lanes (responder, classifier, ack) take no settings argument at
504
+ // all and are still governed by the machine; they run on an explicit
505
+ // `--append-system-prompt` and emit a line rather than a report, so they are a
506
+ // smaller surface, but they are NOT covered here.
507
+ //
508
+ // Path B: a cohort-llm retarget additionally authenticates through the
509
+ // seat-token helper, which Claude Code only reads from settings (child-env
510
+ // COHORT_HELPER_KEY). Merged into the same object, never a second --settings.
511
+ const sessionSettings = { outputStyle: SEAT_OUTPUT_STYLE };
512
+ if (envResult.retargeting && isCohortHelperRetarget(i.retarget)) {
513
+ sessionSettings.apiKeyHelper = i.retarget[COHORT_HELPER_KEY];
514
+ }
515
+ const settings = ["--settings", JSON.stringify(sessionSettings)];
468
516
  const x = { perm, mcp: mcpArgs(i.mcp, d), knobs: knobArgs(i.knobs), settings };
469
517
  const argv = spec.argv(input, x);
470
518
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cohortapp/agent-sdk",
3
- "version": "2.18.27",
3
+ "version": "2.18.29",
4
4
  "description": "Cohort Agent SDK — autonomous AI colleague runtime. Deploy senior AI colleagues on dedicated Mac minis, wired to the Cohort operating surface.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -371,6 +371,31 @@ mkdir -p "$CLAUDE_SETTINGS_DIR"
371
371
  # RCE vector — and have been removed entirely. Collective-memory hooks are
372
372
  # wired separately and idempotently by `maestro global-setup` below, which
373
373
  # deep-merges its own hooks.)
374
+ # NO OUTPUT-STYLE PLUGINS ON A SEAT.
375
+ #
376
+ # explanatory-output-style and learning-output-style were both enabled in the
377
+ # enabledPlugins block below, and both are wrong for an agent seat: a seat does
378
+ # not write for a developer at a terminal, it posts to colleagues in a room.
379
+ #
380
+ # explanatory instructs the model to wrap its work in decorative teaching
381
+ # blocks. Observed 2026-09-30 20:12:55Z: a seat posted one verbatim into a
382
+ # shared engineering channel, backticks and box-drawing rules included, in the
383
+ # middle of a status message.
384
+ #
385
+ # learning instructs the model to stop and ask the reader to write 5-10 lines
386
+ # of code, marked with a TODO. A seat answering a colleague must never hand
387
+ # back homework.
388
+ #
389
+ # Enabling the plugin is what turns the style ON, not merely what makes it
390
+ # available: the machines exhibiting this carry no separate outputStyle key, and
391
+ # a session on a box with both enabled reports itself in learning mode. So
392
+ # listing them here was a fleet-wide activation.
393
+ #
394
+ # This fixes seats provisioned from here on. An existing seat still carries the
395
+ # flags in its own global settings file and has to be cleaned there. The upgrade
396
+ # path deliberately does not rewrite a machine global settings file, because
397
+ # silently editing 16 operator configs is not a repair an upgrade is entitled to
398
+ # make; the remediation is a one-line edit the operator runs.
374
399
  MAESTRO_SETTINGS_ADDITIONS='{
375
400
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
376
401
  "enabledPlugins": {
@@ -398,8 +423,6 @@ MAESTRO_SETTINGS_ADDITIONS='{
398
423
  "remember@claude-plugins-official": true,
399
424
  "mcp-server-dev@claude-plugins-official": true,
400
425
  "zapier@claude-plugins-official": true,
401
- "explanatory-output-style@claude-plugins-official": true,
402
- "learning-output-style@claude-plugins-official": true,
403
426
  "claude-mem": true,
404
427
  "claude-pace": true
405
428
  },