refactor(code): agent loop inference/executor seams + Linear telemetry#4
Merged
Merged
Conversation
Extract Anthropic streaming and tool execution from the monolithic loop so headless, TUI, coordinator, and GitHub runners share the same wiring. Add optional Linear issue linking on traces and a headless watchdog for wall-clock and token budgets. Co-authored-by: Cursor <cursoragent@cursor.com>
- Extract and consolidate StatusBar, LiveRegion (+ToolSpinner), HistoryView, InputArea, and PermissionPrompt as proper Bubble Tea components - Full dual-state migration followed by ownership consolidation passes: - HistoryView owns viewport + RenderedTurn list (legacy m.history/m.viewport removed) - LiveRegion owns active tools, streaming, and completed tools (legacy fields removed) - InputArea owns textarea, messageQueue, and autocomplete state (syncInputArea removed) - PermissionPrompt owns prompts + batch (old internal/tui/permission.go deleted) - Centralize all styles in internal/tui/styles/colors.go - Add real Guard integration: - assessPermissionRisk with file-sensitive + dangerous bash pattern detection - SetGuardRisk + GuardRiskLevel/Reason on Model - StatusBar renders risk state (● CAUTION / HIGH with reason) - Implement Command Palette with semantic actions (ActionKey), Category, Shortcut, and RiskLevel metadata (not just text injection) - Major coverage improvements: - strip.go sanitizers (security-adjacent paste handling) - Guard heuristics (table-driven + event-driven tests) - Component + integration tests across the new layer - Update all tests (zero snapshot drift), design docs, AGENTS.md, and beads queue for the dcode-001 epic All prior behavior preserved. Full test suite green.
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.
Summary
InferenceDriver(Anthropic streaming → semantic events) andToolExecutor(permissions, Warden, registry execute), wired from headless, TUI, coordinator, bridge, and GitHub runner entry points.--linear-issueflag, branch auto-detect (CLO-123), context helpers, andLinkTraceon trace start whenLINEAR_API_KEYis set.CONTEXT.mdand align design doc §2.9 with input-aware permission rules.Test plan
CGO_ENABLED=0 go test ./...drover-code --headless --prompt "say hi"with and without--linear-issueMade with Cursor