Skip to content

fix(bin): pass the task record to agent_state so OMP lanes resolve - #123

Merged
EvanAgee merged 2 commits into
mainfrom
fm/fm-control-omp-agent-state-meta
Sep 16, 2026
Merged

EvanAgee merged 2 commits into
mainfrom
fm/fm-control-omp-agent-state-meta

Conversation

@EvanAgee

@EvanAgee EvanAgee commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two small edits left uncommitted in the primary checkout, landed as a direct PR (captain-approved 2026-09-16).

  • bin/fm-control.sh: agent_state() now forwards the task record as the third argument, fm_backend_agent_state "$BACKEND" "$T" "$META". Without it the tmux probe cannot bind an OMP lane's launch-bound Bun/OMP identity, so every interrupt, exit, and relaunch on an OMP lane read ambiguous. It is the only fm_backend_agent_state caller in the file. Backlog item: fm-control-omp-agent-state-meta.
  • docs/dashboards.md: adds the bluray.agee.dev host row and its section. Backlog item: fm-docs-dashboards-bluray-commit.

Test changes

The existing exit on omp should succeed case broke with the meta forwarding, because the probe reads an omp record without omp_bin/omp_bun as unreadable (production records carry them; bin/fm-spawn.sh writes them). The test now models production: the fake task meta for harness=omp binds two real executables, and the tmux stub answers pane_pid plus a fake ps/lsof pair against a fixed pid pair so the identity probe can complete; every other ps/lsof invocation delegates to the real tools.

The focused assertion the brief asked for was cheap, so it exists: fm-control exit: an omp record without its bound identity is unreadable, not alive proves agent_state forwards the meta path (with the old two-argument call that case would classify alive and succeed).

Validation

  • bin/fm-test-run.sh tests/fm-control*.test.sh: 3 scripts, 0 failed (fm-control.test.sh, fm-control-relaunch.test.sh, fm-control-herdr-smoke.test.sh).
  • bin/fm-lint.sh (pinned ShellCheck 0.11.0, the repo's lint owner): clean. A bare shellcheck bin/fm-control.sh reports the same two pre-existing SC2034/SC1091 notes on main and with this change alike; the pinned lint config is the owner and passes.
  • bin/fm-doc-audience-check.sh: ok.
  • npx unslop: no supported-file findings for the changed shell and markdown files.

What I walked

This repo has no preview deployment; the walk is the test run plus a read-only live-lane check.

  • bin/fm-test-run.sh tests/fm-control*.test.sh (full output summary):

    FM_TEST_END ... tests/fm-control-herdr-smoke.test.sh exit=0 duration_ms=8213 gate_skip=false
    FM_TEST_END ... tests/fm-control-relaunch.test.sh exit=0 duration_ms=94212 gate_skip=false
    FM_TEST_END ... tests/fm-control.test.sh exit=0 duration_ms=51398 gate_skip=false
    FM_TEST_SUMMARY total=3 failed=0 skipped_gate=0 duration_ms=154027
    

    The previously failing exit on omp should succeed case now passes, along with the new unbound-record refusal assertion.

  • Two live OMP lanes are running in the primary home (fm-aos-3771-saved-reply-missing-text and fm-aos-3847-chat-title-duplicates show a bun foreground process in tmux list-windows), and the first lane's task record carries the identity keys this fix relies on (harness=omp, omp_bin=.../@oh-my-pi/pi-coding-agent/dist/cli.js, omp_bun=.../.bun/bin/bun). Per the brief I ran only the read-only help path against a live lane, never interrupt, exit, or relaunch:

    $ FM_HOME=/Users/evanagee/Sites/firstmate bin/fm-control.sh aos-3771-saved-reply-missing-text --help
    error: '--help' is not a control verb
    allowed verbs:
      interrupt
      exit
      relaunch
    

No screenshots needed (no user-visible UI change).

Summary by CodeRabbit

  • Bug Fixes

    • Improved OMP lane state reporting by validating process identity metadata, preventing ambiguous or stale results from being treated as active.
  • Documentation

    • Added bluray.agee.dev to the dashboard reference, including its host configuration, combined Blu-ray and UPCitemdb interface details, deployment requirements, and restart procedure.
    • Documented that the host should remain protected by Cloudflare Access and that the web bundle must be rebuilt before restarting the service.
  • Tests

    • Expanded control-plane coverage for OMP process identity validation and unreadable task records.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 26268f5e-41ec-40f4-bd0c-d7f9b7d3899c

📥 Commits

Reviewing files that changed from the base of the PR and between 71d47fd and 7f5cbe2.

📒 Files selected for processing (3)
  • bin/fm-control.sh
  • docs/dashboards.md
  • tests/fm-control.test.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

OMP state binding

Layer / File(s) Summary
Bind metadata to OMP state checks
bin/fm-control.sh, tests/fm-control.test.sh
agent_state passes task metadata to backend state checks. Test fixtures simulate OMP process identity and bound executable paths.
Reject unbound OMP records
tests/fm-control.test.sh
The test suite verifies that fm-control exit rejects an OMP record without identity bindings as unreadable.

Blu-ray dashboard documentation

Layer / File(s) Summary
Document Blu-ray host operations
docs/dashboards.md
The dashboard reference adds the Blu-ray host details, service description, Cloudflare Access requirement, build instructions, and restart recipe.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: kunchenguid

Merge Risk: ⚪ Minimal · up to 7f5cb

The OMP state-binding change and Blu-ray operational documentation have no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: passing the task record to agent_state to resolve OMP lane identity.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fm/fm-control-omp-agent-state-meta

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EvanAgee

Copy link
Copy Markdown
Owner Author

On the docstring-coverage warning: this repo's shell convention (see bin/) is inline # usage-header comments rather than docstrings, and the touched functions carry them. The only red required check, 'PR must be raised via no-mistakes', is expected here: this PR is a captain-approved direct PR and was intentionally not raised through the no-mistakes pipeline, so it cannot carry that body signature. All other checks are green.

@EvanAgee EvanAgee added the agent-pr-watched An agent merge watch is armed on this PR label Sep 16, 2026
@EvanAgee
EvanAgee merged commit 957bbdf into main Sep 16, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr-watched An agent merge watch is armed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant