Skip to content

The action hook resolves project/type when its callers have none, so arrange stops refusing hand-started seats (#1137) - #1192

Merged
fujibee merged 2 commits into
integration/terminal-driver-v1from
fix/1137-action-hook-project-type
Sep 14, 2026
Merged

The action hook resolves project/type when its callers have none, so arrange stops refusing hand-started seats (#1137)#1192
fujibee merged 2 commits into
integration/terminal-driver-v1from
fix/1137-action-hook-project-type

Conversation

@fujibee

@fujibee fujibee commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Fixes #1137.

send.sh/inbox.sh/history.sh call agmsg_self_name_on_action with only <team> <agent> — they never had a project or type to pass, not merely forgot to (verified: neither variable exists anywhere in any of the three files). The hook forwarded that straight through to the placement-record writer, so a record written by acting — the #1109 path, the one that exists for hand-started seats — carried two empty fields. arrange.sh requires both and refuses such a record outright with "missing project or type"; the issue measured 12 of 36 placement records stuck this way on one live machine, including seats in daily use.

Coordination note

scripts/lib/self-name.sh (the action-hook path this fixes) is the exact layer #1152/#1157 (feat/1152-self-write, still open) plans to remove and replace. Cross-checked with the #1157 author before starting: their new writer (agmsg_self_write) already requires project/type as non-optional and has its own test for that; this fix is scoped to the current, still-live path only, and does not touch anything #1157 changes (no file overlap — confirmed by running the full affected suites, listed below). They're dropping Closes #1137 from #1157's body so the two don't race to close the same issue.

Fix

Resolve project/type inside agmsg_self_name_on_action itself, the same way whoami.sh already answers the identical question (agmsg_detect_cli_type, agmsg_resolve_project), instead of threading two new arguments through three callers that have no better source for them than this process's own cwd and type anyway. Only when the caller did not already supply them, and only right before the slow-half write — the common fast-path short-circuit (the cheap case this hook is designed around) is untouched. Best-effort, matching every other lazy source in this function: a resolution failure leaves the field empty exactly as before, never blocks the naming this hook exists to do.

Verification

  • tests/test_self_name.bats gains the failing-side control the day's standard calls for: a hand-started seat's action-hook record now carries non-empty project/type — verified red by reverting the fix and re-running (project empty, assertion fails) — and a caller that already supplies both explicitly is never second-guessed (its exact values pass through unchanged).
  • Full file re-run after restoring the fix: test_self_name.bats 25/25, test_dispatch.bats 15/15, test_delivery.bats 198/198, test_terminal_registry.bats 166/166 — all clean.
  • check-enforced-assertions.sh: 626/626, baseline unchanged.
  • bash -n scripts/lib/self-name.sh: OK.

Base: integration/terminal-driver-v1 tip at branch time (026d10f4).

…ave none (#1137)

send.sh/inbox.sh/history.sh call agmsg_self_name_on_action with only
<team> <agent> -- they never had a project or type to pass, not
merely forgot to. The hook forwarded that straight through to the
placement-record writer, so a record written by acting (the #1109
path, the one that exists for hand-started seats) carried two empty
fields. arrange.sh requires both and refuses such a record outright;
measured live, 12 of 36 placement records on one machine were stuck
this way.

Resolve project/type inside the hook itself, the same way whoami.sh
already answers the identical question (agmsg_detect_cli_type,
agmsg_resolve_project), instead of threading two new arguments
through three callers that have no better source for them than this
process's own cwd and type anyway. Only when the caller did not
already supply them, and only right before the slow-half write --
the common fast-path short-circuit is untouched. Best-effort,
matching every other lazy source in this function: a resolution
failure leaves the field empty exactly as before, never blocks the
naming this hook exists to do.

tests/test_self_name.bats gains the failing-side control: a
hand-started seat's action-hook record now carries non-empty
project/type (verified red against a revert of this fix), and a
caller that already supplies both is never second-guessed.
…aseline

The four new lazy-source lines added for #1137 read \$SKILL_DIR
unguarded, tripping check-unguarded-env-reads.sh from 89 to 93 (the
file's own \${SKILL_DIR:=...} default-assignment at sourcing time
guarantees it in practice, but the checker's assignment detection
does not recognize that form). Give each read the same default the
checker itself suggests; SKILL_DIR is never actually empty here, so
this changes nothing at runtime.

Diff method per tonight's standard: baseline forced to 0 on both
base (026d10f) and this head, offender lists diffed -- exactly the
four new lines, nothing else moved.
@fujibee
fujibee merged commit 3df9059 into integration/terminal-driver-v1 Sep 14, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant