feat(tui): /model command with provider-grouped model picker - #4
Merged
Conversation
added 3 commits
July 13, 2026 21:02
- Add Provider.Name field for display names in model palette - Add Defaults.Provider for explicit default provider selection - Add ModelLister interface + OpenAIClient.ListModels (GET /v1/models) - Add Provider.Models override in config to skip API query - Pre-fetch all provider models at TUI startup (background goroutine) - Model palette groups by provider name with bold headings - Up/down navigation, type-to-filter, enter to select, esc to cancel - Session-only model switching via sessionModel (no config persistence) - Dynamic viewport adjustment (paletteLines + maxModelLines) - Fix adjustViewport to account for modelMode (not just commandMode) - Update resolveProviderName to check default.provider first - Update scaffold config with name, provider, models examples
buchenberg
added a commit
that referenced
this pull request
Aug 4, 2026
Renamed across all packages:
- MaxIterations -> MaxLoopCycles (hard limit on total loop cycles)
- MaxTurns -> MaxToolTurns (when tools are stripped)
- WrapUpAhead -> WrapUpThreshold (wrap-up notice threshold)
- WrapUpTurns -> WrapUpThreshold (config yaml alias)
- injectWrapUp -> injectWrapUpNotice
YAML tags preserved for backward compat ('max_iterations', 'max_turns',
'wrap_up_turns' remain unchanged).
Touches: agent, config, pipeline, tools, subagent, cmd/yaah packages.
buchenberg
added a commit
that referenced
this pull request
Aug 4, 2026
…#131) * refactor: complete CtxMgr/Persister/Hooks migration, remove deprecated Loop fields * refactor: decompose Loop struct into LoopConfig + LoopState sub-types (P0 #1) Split the ~70-field Loop struct into: - LoopConfig: 32 immutable config fields (Model, MaxIterations, ContextWindow, etc.) - LoopState: 14 mutable runtime fields (Messages, TotalTokens, etc.) - Loop: ~28 dependency/internals (Provider, Registry, CtxMgr, Persister, etc.) Renamed options.LoopConfig -> AgentConfig and WithLoopConfig -> WithAgentConfig to avoid collision with the new LoopConfig sub-struct type. Addresses ARCHITECTURE-REVIEW.md P0 #1 'Refactor Loop struct into composed types.' * refactor: decompose runMiddleware into logical helpers (P0 #2) Extracted 7 focused methods from the ~320-line runMiddleware: - publishDone / teardown: deferred cleanup (broker, persister, hooks) - initMessages: conversation initialization and session-start hooks - buildTurnRequest: PrepareStep middleware + request construction + MaxTurns - guardContextBeforeCall: pre-flight compaction + payload guard - recordTurnSpanAttrs: OTel span attribute population - executeToolPhase: tool truncation, execution, conflict detection, PostTool runMiddleware reduced from ~320 lines to ~180 lines with clear delegation. * refactor: clarify turn vs iteration naming (P1 #4) Renamed across all packages: - MaxIterations -> MaxLoopCycles (hard limit on total loop cycles) - MaxTurns -> MaxToolTurns (when tools are stripped) - WrapUpAhead -> WrapUpThreshold (wrap-up notice threshold) - WrapUpTurns -> WrapUpThreshold (config yaml alias) - injectWrapUp -> injectWrapUpNotice YAML tags preserved for backward compat ('max_iterations', 'max_turns', 'wrap_up_turns' remain unchanged). Touches: agent, config, pipeline, tools, subagent, cmd/yaah packages. * docs: update ARCHITECTURE-REVIEW with implementation status * fix: gofmt cmd/yaah/agent_frame.go
buchenberg
added a commit
that referenced
this pull request
Aug 7, 2026
…anup - Thread pane width through renderMarkdown via GetInnerRect().Dx() instead of hard-coded 80 columns (CodeRabbit #6) - Update architecture review: tui2 markdown entry now says tviewmd instead of glamour (#4), model-picker wiring is partial not missing (#5) - Add language identifiers to unlabeled code fences in plan (#markdownlint) - Phase 1 text already replaced by checkmarked completion in amended commit
buchenberg
added a commit
that referenced
this pull request
Aug 7, 2026
* feat: extract tviewmd markdown renderer and wire into tui2 Replace glamour+TranslateANSI in tui2 with native tview color-tag rendering via the published github.com/buchenberg/tviewmd module (v0.1.0). The tviewmd module (14 files, MIT) provides: - CommonMark + GFM parsing via goldmark - chroma syntax highlighting for fenced code blocks - tview color-tag backend (no ANSI round-trip) - 23 tests + fuzz (315k+ executions, zero panics) Adds architecture review (docs/architecture-review.md) and implementation plan (.agents/plans/tui2-hardening/PLAN.md). * feat: extract tviewmd markdown renderer and wire into tui2 Replace glamour+TranslateANSI in tui2 with native tview color-tag rendering via the published github.com/buchenberg/tviewmd module (v0.1.0). The tviewmd module (14 files, MIT) provides: - CommonMark + GFM parsing via goldmark - chroma syntax highlighting for fenced code blocks - tview color-tag backend (no ANSI round-trip) - 23 tests + fuzz (315k+ executions, zero panics) Adds architecture review (docs/architecture-review.md) and implementation plan (.agents/plans/tui2-hardening/PLAN.md). * fix: address PR review — dynamic markdown width, stale docs, plan cleanup - Thread pane width through renderMarkdown via GetInnerRect().Dx() instead of hard-coded 80 columns (CodeRabbit #6) - Update architecture review: tui2 markdown entry now says tviewmd instead of glamour (#4), model-picker wiring is partial not missing (#5) - Add language identifiers to unlabeled code fences in plan (#markdownlint) - Phase 1 text already replaced by checkmarked completion in amended commit * docs(architecture): add deep-dive review of tui2 internals Expand the architecture review with a comprehensive §4 section covering `internal/tui2`'s package topology (~19 subpackages), the flat-factory component pattern, and an analysis of the imperative widget tree model with its strengths (simplicity, zero abstraction overhead) and weaknesses (no lifecycle standardization, lack of isolation via shared *App). Update the §3 recommendation to reference the new deep-dive section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Model switching
Config enhancements
Provider client
Bug fixes
Tests