Skip to content

Dashboard answers and operator messages never reach agents when tmux pane-base-index is 1 #80

Open

Description

@ecoinfoai

Summary

Clarification answers and operator messages typed in the dashboard never reach the agent when the user's tmux config sets pane-base-index 1. The dashboard still marks the clarification done, so the operator believes it was answered while the agent waits forever.

This is the same class of bug as #16, which fixed the launcher and notifier; the dashboard's own target builder was not covered.

Cause

swarmforge/scripts/pack_web.bb (main at f4f5fbc, lines 569–574) hardcodes pane 0:

(defn pane-target [row]
  (let [session (session-name row)
        window (nth row 4 nil)]
    (if (str/blank? window)
      session
      (str session ":" window ".0"))))

With setw -g pane-base-index 1 the agent pane is .1, so inject-target! runs tmux send-keys -t swarmforge-specifier:Specifier.0 …, which fails with can't find pane: 0. The only trace is in .swarmforge/dashboard.log:

inject failed role=specifier socket=/tmp/swarmforge-<user>/<n>.sock error=tmux send-keys failed

swarmforge.bb already detects both base indexes (detect-tmux-base-indexes, tmux-agent-target); pack_web.bb does not use them. capture-pane through the same pane-target (agent pane view) is affected the same way.

Reproduce

  1. Put setw -g pane-base-index 1 in ~/.config/tmux/tmux.conf.
  2. get-swarm-forge four-pack && ./swarm, create a New Task.
  3. When the specifier posts a clarification, answer it in Attention.
  4. The answer never appears in the specifier's pane; dashboard.log shows inject failed.

Verified against the live server: tmux -S <sock> send-keys -t swarmforge-specifier:Specifier.0 exits 1 (can't find pane: 0), …:Specifier exits 0.

Suggested fix

Target session:window without a pane index (the agent window has exactly one pane), or reuse the detected pane base index. We applied the first in our fork: ecoinfoai@6dc87c9

Environment

NixOS (Linux 7.2), tmux 3.7c, Babashka 1.13.220, four-pack.

Activity

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