Skip to content

plugins/tree: the organizer ignores the plugin's jobTimeoutMs, so a hung host call is only abandoned after the 10-minute default #2800

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 1770031f9b1945de819d70155c476d98
Branch: dev/5-tree-jobtimeout
Base: 5b8d980
At: 2026-11-10T09:23:53Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Bot: FlyBot Dev-5

Problem

plugins/tree declares no way to bound its organizer's host call, and the bound it does have is never read from config.

  • plugins/tree/src/organize.js:21 — DEFAULT_JOB_TIMEOUT_MS = 10 * 60 * 1000.
  • plugins/tree/src/organize.js:33 and :316 — the only readers of jobTimeoutMs; an illegal value falls back to the default.
  • plugins/tree/index.js:22 — apply() never forwards ctx.config.jobTimeoutMs.
  • plugins/tree/src/tree.js:24 — the destructured options omit it, and :87 builds createOrganizer({ … }) without it.

So a config that sets jobTimeoutMs is accepted and silently ignored: a hung bot.create on a queued reorganization is abandoned after 600000 ms (ten minutes) no matter what was configured, and nothing in the log says the value was dropped.

This is the queued path only (create_team → organizer queue). The single-call path is a separate defect and out of scope here.

Reproduction (red first, on live main)

plugins/tree/test/job-timeout-config.test.js on a clean checkout, only the test added, no source change:

$ TZ=UTC node --test test/job-timeout-config.test.js
# tests 2 / # pass 1 / # fail 1 / # cancelled 0

Failing assertion, verbatim from the run:

jobTimeoutMs in the plugin config was ignored; warnings: flybot-tree: reorganization job reorg-1 was abandoned after 600000ms: the host call never settled; later reorganizations continue

The test first asserts the host was really called (hostCalls === 1, from a create_team that builds FlyBot Lead), then asserts /abandoned after 30ms/ on the collected warnings. The 600000 ms in the message is the default, which is the defect: the configured value never reached the organizer.

Note on the harness: the test clamps its own setTimeout to 250 ms, so the default tier fires inside the test instead of stalling the suite for ten minutes. That clamp is in the fixture, not in the plugin — the production default stays ten minutes.

Expected

The plugin's jobTimeoutMs reaches the organizer:

  1. index.js:22 passes ctx.config.jobTimeoutMs; tree.js:24 destructures it and :87 forwards it to createOrganizer.
  2. Only a finite positive number of milliseconds takes effect: Number.isFinite(v) && v > 0. 0, -5, '30' (string), NaN, Infinity and null all fall back to the 10-minute default — no crash, no zero-length timeout.
  3. With the value honoured, the same queued job is abandoned after the configured 30 ms and the warning says 30ms, not 600000ms.

Scope

  • plugins/tree/index.js — forward the config value.
  • plugins/tree/src/tree.js — accept it in the options and pass it into createOrganizer.
  • plugins/tree/test/job-timeout-config.test.js — new: the queued path, the red-first assertion above, plus a case for the illegal-value fallback.
  • docs/subsystems/tree.md — document the key and its accepted range.
  • changelog.d/<issue>-tree-job-timeout-config.fixed.md — user-visible behaviour change (a config key that finally works).
  • Not this: the ordinary single create_child_bot path (separate defect), and plugins/tree/src/organize.js's default itself, which stays at ten minutes.

Acceptance

  1. Red first: on clean main with only the new test, exactly one assertion fails with the message above (pass 1 / fail 1); no source file is touched to obtain it.
  2. After the fix: TZ=UTC node --test test/job-timeout-config.test.js → 2/2, including the illegal-value fallback.
  3. plugins/tree full suite green (145/145 as measured pre-PR) and the neighbour organize-queue-bound.test.js 3/3.
  4. TZ=UTC npm run verify green for the changed tree (known machine-only exception, reproduced on base: core/test/bench-preflight.test.js fails with mkdir: not found when the fixture strips a PATH that contains pnpm; that red is identical on the base commit and is not caused by this change).
  5. Lint, arch-docs, changelog fragment well formed.

Risk tier

T2 by path (plugins/**), so this needs the repository reviewer's Verdict at the tip; no generate and no client bundle, so it does not touch the single-lane artifacts.

Dedup (checked when filed)

Live main 5b8d980f: jobTimeoutMs appears in the whole tree only at plugins/tree/src/organize.js (the reader that nobody feeds) and plugins/tree/test/organize-queue-bound.test.js; no config declares or forwards it. GitHub issue search for jobTimeoutMs returns one item, #2633 (closed, the Bot Social REST fallback's own timeout — different code, different symptom). No open or closed issue describes the tree organizer ignoring this key.

Activity

  1. added a commit that references this issue on Nov 10, 2026
    f42ad01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions