You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TASK] Refactor isInputBlocked to drop unreachable view checks and stale ponytail markers #1921
ChatApplication.isInputBlocked in internal/presentation/tui/app/chat.go returns currentView != tui.ViewStateChat || ... || currentView == tui.ViewStateDiffViewer || currentView == tui.ViewStateExplorer || currentView == tui.ViewStateHelp. The last three operands can never change the result, because each of those views already makes the first operand currentView != tui.ViewStateChat true. All four operands came in one commit, so the trailing ones read like extra rules when they are dead. Principle: clean-code "dead code and unreachable branches" (delete them).
The marker above it, // ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessages, is a deferred-shortcut marker with no limit and no upgrade trigger, and the code has outgrown it. isInputBlocked is now a shared predicate called from handleViewSpecificMessages (twice), from CanRequestSuggestion and from chat_workspaces_test.go, not a helper split off one function. The same kind of non-deferral marker sits on inspectPluginHooks in internal/plugins/installer.go (// ponytail: extracted to reduce nestif complexity in Inspect. followed by ceiling: none). Neither marker records a shortcut, yet the shortcut ledger counts both as debt with no trigger. Principle: clean-code "comments that no longer match the code", and the ledger rule that a marker names a limit and an upgrade trigger.
Acceptance Criteria
Before: isInputBlocked ends with || currentView == tui.ViewStateDiffViewer || currentView == tui.ViewStateExplorer || currentView == tui.ViewStateHelp. After: those three operands are removed and currentView != tui.ViewStateChat alone covers every non-chat view.
Before: isInputBlocked carries // ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessages. After: the marker is removed and replaced by a short doc comment that says what blocks input (a non-chat view, a pending approval, plan approval or user question, a retry, a teleport, or message-history mode).
Before: inspectPluginHooks carries the three-line ponytail: / ceiling: none / upgrade: marker. After: the marker is removed and replaced by a one-line doc comment that says what the function returns.
Done. Refactor complete and pushed - PR #1922 (ready for review, Resolves #1921).
What changed (commit faa0094a, one commit, +5/-8):
internal/presentation/tui/app/chat.go: dropped the three unreachable operands from isInputBlocked's tail (== tui.ViewStateDiffViewer, == tui.ViewStateExplorer, == tui.ViewStateHelp) - currentView != tui.ViewStateChat alone covers every non-chat view. Replaced the stale // ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessages marker with a doc comment listing what actually blocks input (non-chat view, pending approval, plan approval or user question, retry, teleport, message-history mode) - the predicate is now a shared gate used by handleViewSpecificMessages, CanRequestSuggestion and chat_workspaces_test.go, not an extraction of one function.
internal/plugins/installer.go: removed the three-line ponytail: / ceiling: none / upgrade: marker on inspectPluginHooks and stated in one line what it returns (whether hooks exist, the parsed hook commands, a validation error for an invalid hooks.yaml).
All acceptance criteria met; behavior is provably unchanged, so no tests needed edits. Verified with go test ./internal/presentation/tui/app ./internal/plugins and task precommit:run (mod tidy, mocks, fmt, import-alias lint, golangci-lint, markdownlint) - all green. Issue also tracked on the Roadmap 2026 board (Status: QA until the PR merges).
Skipped: a marker-scan ledger update (none exists in-repo; the ponytail notes are inline comments only) and a docs ticket (internal-only refactor, stated in the PR body). Risk: none beyond comment-only drift - the deleted operands were logically dead for every input.
Activity
edenreich commentedon Nov 20, 2026
@infer can you work on this? use /ponytail:ponytail /domain-driven-design /go /go-concurrency
inference-gateway-maintainer commentedon Nov 20, 2026
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.11· CLI:v0.263.0· Gateway:v0.68.0· View JobTodos
Pull Request
#1922
✅ Infer Result: Success
Done. Refactor complete and pushed - PR #1922 (ready for review, Resolves #1921).
What changed (commit
faa0094a, one commit, +5/-8):internal/presentation/tui/app/chat.go: dropped the three unreachable operands fromisInputBlocked's tail (== tui.ViewStateDiffViewer,== tui.ViewStateExplorer,== tui.ViewStateHelp) -currentView != tui.ViewStateChatalone covers every non-chat view. Replaced the stale// ponytail: extracted to reduce cyclomatic complexity of handleViewSpecificMessagesmarker with a doc comment listing what actually blocks input (non-chat view, pending approval, plan approval or user question, retry, teleport, message-history mode) - the predicate is now a shared gate used byhandleViewSpecificMessages,CanRequestSuggestionandchat_workspaces_test.go, not an extraction of one function.internal/plugins/installer.go: removed the three-lineponytail: / ceiling: none / upgrade:marker oninspectPluginHooksand stated in one line what it returns (whether hooks exist, the parsed hook commands, a validation error for an invalid hooks.yaml).All acceptance criteria met; behavior is provably unchanged, so no tests needed edits. Verified with
go test ./internal/presentation/tui/app ./internal/pluginsandtask precommit:run(mod tidy, mocks, fmt, import-alias lint, golangci-lint, markdownlint) - all green. Issue also tracked on the Roadmap 2026 board (Status: QA until the PR merges).Skipped: a marker-scan ledger update (none exists in-repo; the ponytail notes are inline comments only) and a docs ticket (internal-only refactor, stated in the PR body). Risk: none beyond comment-only drift - the deleted operands were logically dead for every input.
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.11· CLI:v0.263.0· Gateway:v0.68.0· Exit Code:0· Duration: 4m 58sTokens: 1,342,383 in · 12,063 out · 1,354,446 total (25 requests)
Tool calls: 40 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Nov 20, 2026
🎉 This issue has been resolved in version 0.265.4 🎉
The release is available on:
Your semantic-release bot 📦🚀