Skip to content

Review: 44a884e#2

Merged
samarth-na merged 1 commit into
mainfrom
dev
Jul 13, 2026
Merged

Review: 44a884e#2
samarth-na merged 1 commit into
mainfrom
dev

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Code Review

Automated review of the last commit on dev.

Review Output

## Code Review

### 1. Orphaned / Dead Code
The bash script `change-tmux-pane.sh` is a verbatim translation of the existing fish function `changeTmuxPane` in `non-interactive.fish`. However, it is **never sourced, called, or wired to any keybinding**. It's dead code — a maintenance liability with zero benefit unless the intent is to support non-fish shells (and even then, it's not integrated).

### 2. `|| true` Silently Swallows Errors
```sh
tmux switch-client -t "$target" 2>/dev/null || true

Errors from switch-client are redirected to /dev/null and masked by || true. The fish version at least prints a message to stderr (or echo "" >&2). This makes debugging failures (e.g., malformed target from a session name containing dots) impossible.

3. No fzf-tmux Dependency Check

If fzf-tmux is not installed (or tmux popup mode is unavailable), the pipeline fails with a cryptic error from the shell, not a helpful message.

4. Missing AGENTS.md Update

The new script is not documented in AGENTS.md under Layout or Gotchas, so future readers won't know it exists or that it's a bash equivalent of the fish function.

What's Fine

  • No security issues (no external input, no secrets, no injection vectors).
  • No performance regression (single-shot script).
  • AGENTS.md formatting changes (blank lines) are harmless.
  • The cut -d "." -f 1 parsing works for typical session names; the same logic exists in the fish version, so not a regression.

Bottom line: Remove the orphaned bash script unless there's a concrete plan to wire it up from bash contexts, or wire it up and update AGENTS.md.


---
_Generated by OpenCode Review_

@samarth-na

Copy link
Copy Markdown
Owner

/oc why is this not showing up in linear review?

@opencode-agent

Copy link
Copy Markdown

I can't tell from this repo — Linear's review queue is configured on the Linear side (GitHub integration settings, label/repo filters, branch rules). A few things to check there:

  1. The PR author is github-actions — if the integration only picks up PRs from human authors or a specific bot, it'll be skipped.
  2. The branch is devmain — some setups only watch PRs into main from specific head branches (or vice versa).
  3. Title prefix is Review: ... — if you filter by title pattern (e.g., [review]), this won't match.
  4. Linear's GitHub sync status for this repo — it may need to be re-linked or the repo re-authorized.

Nothing in the repo (AGENTS.md, workflows, etc.) hints at a Linear wiring, so it's almost certainly a Linear-side config issue, not something this PR is doing wrong.

New%20session%20-%202026-07-13T21%3A02%3A19.415Z
opencode session  |  github run

@samarth-na

Copy link
Copy Markdown
Owner

/oc will adding me as a reviewer while making pr inside the action fix this? read

@samarth-na
samarth-na self-requested a review July 13, 2026 21:05
@opencode-agent

Copy link
Copy Markdown

No. Linear's GitHub integration typically keys off the PR author, not reviewers — and this PR is authored by github-actions. Adding you as a reviewer won't change that.

Likely fixes, in order of probability:

  1. Have the action open the PR as you (e.g. via gh pr create --author @me / GITHUB_TOKEN of a user PAT, or push the branch under your account) so the author isn't the bot.
  2. Check Linear's GitHub integration filters for this repo — repo allowlist, author filter, label filter, branch rules (devmain vs main only), and title-pattern filters (your Review: ... prefix may not match its regex).
  3. Re-link / re-authorize the repo in Linear's GitHub settings if the integration was just added.

If the goal is just "make sure a human sees it before merge," assigning yourself is fine — but it won't make Linear pick it up.

New%20session%20-%202026-07-13T21%3A05%3A44.910Z
opencode session  |  github run

samarth-na commented Jul 13, 2026

Copy link
Copy Markdown
Owner

/oc inside this page i clicked on request a review for myself and i it got to show up in linear how do i do this with acitons.

Copy link
Copy Markdown
Owner

/oc inside this page i clicked on request a review for myself and i it got to show up in linear how do i do this with acitons.

Copy link
Copy Markdown
Owner

/oc inside this page i clicked on request a review for myself and i it got to show up in linear how do i do this with acitons.

@samarth-na samarth-na left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s

@opencode-agent

Copy link
Copy Markdown

The trigger is the review-request event, not the author. When you click "Request a review" on the PR page, Linear's GitHub integration sees the review_requested event (or the PR landing in your review queue) and syncs it.

To make the action do the same, it needs to add you as a reviewer after the PR is created. Either:

gh pr edit "$PR_URL" --add-reviewer samarth-na

or via the API:

curl -X POST \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/samarth-na/dotfiles/pulls/<num>/requested_reviewers \
  -d '{"reviewers":["samarth-na"]}'

Add that step right after the gh pr create step in the workflow.

Heads up: there's no .github/workflows/ in this dotfiles repo, so the workflow lives in the opencode infra repo — the change has to go there, not here.

New%20session%20-%202026-07-13T21%3A09%3A34.873Z
opencode session  |  github run

@opencode-agent

Copy link
Copy Markdown

Add yourself as a requested reviewer right after the PR is created. Linear's GitHub integration syncs on the review_requested event, so that's the trigger:

gh pr edit "$PR_URL" --add-reviewer samarth-na

or via the API:

curl -X POST \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/samarth-na/dotfiles/pulls/<num>/requested_reviewers \
  -d '{"reviewers":["samarth-na"]}'

Drop it as a step right after gh pr create in the opencode-infra workflow (this dotfiles repo has no .github/workflows/, so the change belongs in the opencode infra repo, not here).

New%20session%20-%202026-07-13T21%3A09%3A53.527Z
opencode session  |  github run

Comment thread AGENTS.md
@@ -1,21 +1,25 @@
# AGENTS.md

## Scope

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/oc is this optimal bash code

@opencode-agent

Copy link
Copy Markdown

No. Key issues:

  • || true at change-tmux-pane.sh:14 silently masks switch-client failures — drop it and let the error propagate, or mirror the fish version's or echo "" >&2 fallback.
  • Missing set -euo pipefail — without pipefail, a tmux list-panes or fzf-tmux failure mid-pipeline still yields a non-zero $target handling, and cut exiting non-zero is invisible.
  • No command -v fzf-tmux / command -v tmux guard — current script dies with a cryptic "command not found".
  • Orphan code (already flagged in the review): nothing sources this file or binds it. Either wire it into a keybinding or delete it.

Quick hardening:

#!/usr/bin/env bash
set -euo pipefail

[[ -n "${TMUX:-}" ]] || { echo "Error: Not in a tmux session" >&2; exit 1; }
command -v fzf-tmux >/dev/null || { echo "Error: fzf-tmux not found" >&2; exit 1; }

target=$(tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index}.#{window_name}-#{pane_current_path}' \
    | fzf-tmux -p | cut -d "." -f 1)

[[ -n "$target" ]] && tmux switch-client -t "$target"

New%20session%20-%202026-07-13T21%3A21%3A00.862Z
opencode session  |  github run

@samarth-na
samarth-na merged commit 46d264f into main Jul 13, 2026
5 of 6 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