Commit Graph

2506 Commits

Author SHA1 Message Date
Pedram Amini
f93c4e750b fix(logs): remove truncation from fullCommandPreview in spawn logs
Show complete command with all arguments instead of limiting to first 5
args. Full command visibility is essential for debugging SSH and other
spawn issues.
2026-01-29 15:29:08 -05:00
VVX7
aa91a113cd Add support for Factory.ai droid agent.
See: https://factory.ai/product/cli
2026-01-29 15:29:08 -05:00
Raza Rauf
e9af499004 refactor: extract LiveSessionManager and CallbackRegistry from WebServer
- Extract LiveSessionManager (178 lines) for live session and AutoRun state tracking
- Extract CallbackRegistry (208 lines) for centralized callback management
- Reduce WebServer.ts from 778 to 582 lines (25% reduction)
- Add managers/ directory with proper exports
- Maintain consistent public API (no breaking changes)
2026-01-29 15:27:28 -05:00
Raza Rauf
68945cb946 refactor: restructure web-server module with security and memory leak fixes
- Move WebServer class to dedicated file and add module index
- Extract shared types to centralized types.ts
- Fix XSS vulnerability by sanitizing sessionId/tabId in URL parameters
- Fix IPC listener memory leak with proper cleanup on timeout
- Add autoRunStates cleanup when sessions go offline
- Refactor message handlers with send() and sendError() helpers
- Add XSS sanitization tests and e2e test configuration
2026-01-29 15:27:28 -05:00
Raza Rauf
96357d210e fix: address code review feedback - retry logic and import order
- Add retry logic with exponential backoff for stats DB insertions
  (100ms, 200ms, 400ms delays, max 3 attempts)
- Fix import order in types.ts (move constant after imports)
- Update stats-listener tests for async retry behavior
- Add new test for retry success on transient failure

Addresses review recommendations:
- High: Stats database error handling with retry logic
- Low: Import order consistency
2026-01-29 15:27:09 -05:00
Raza Rauf
90f03fe256 refactor: extract agent error handlers and centralize GROUP_CHAT_PREFIX
- Extract agent:clearError and agent:retryAfterError handlers from
  main/index.ts to dedicated handlers/agent-error.ts module
- Add comprehensive test coverage for agent error handlers (29 tests)
- Centralize GROUP_CHAT_PREFIX constant in process-listeners/types.ts
  to eliminate duplication across 4 listener files
- Remove unused ipcMain import from main/index.ts (all IPC handlers
  now registered through handlers module)
2026-01-29 15:27:09 -05:00
Raza Rauf
944a72cf5a fix: address PR review feedback and add DB caching optimization
PR Review Fixes:
- Fix race condition in exit-listener by moving markAndMaybeSynthesize
  to explicit code paths instead of finally() block
- Add buffer size limits (MAX_BUFFER_SIZE 10MB) with warning logs
- Add REGEX_BATCH_SESSION and REGEX_SYNOPSIS_SESSION for proper filtering
- Fix type safety using canonical ToolExecution and UsageStats imports
- Fix usage-listener indentation bug where safeSend was inside wrong block

Performance Optimizations:
- Add GROUP_CHAT_PREFIX constant for fast string prefix checks
- Skip expensive regex matching for non-group-chat sessions
- Eliminate redundant loadGroupChat calls by using updateParticipant
  return value directly (DB caching)
- Add MSG_ID_RANDOM_LENGTH constant for web broadcast deduplication

Test Coverage:
- Add 4 new test files (exit, data, usage, session-id listeners)
- Total 93 tests covering edge cases, DB caching, and performance
- Verify exact participants data flow from updateParticipant
- Test optional emitter handling and empty participants arrays
2026-01-29 15:26:43 -05:00
Raza Rauf
9ddc95ae7a refactor: extracted process listeners from main/index.ts
- types.ts: ProcessListenerDependencies interface and type re-exports.
- data-listener.ts: Process output streaming with group chat buffering.
- exit-listener.ts: Process exit handling with routing, recovery, synthesis.
- session-id-listener.ts: Agent session ID tracking for group chat.
- usage-listener.ts: Token/cost statistics for participants and moderator.
- error-listener.ts: Agent error logging and forwarding.
- stats-listener.ts: Query-complete events for stats database.
- forwarding-listeners.ts: Simple IPC forwarding (slash-commands, etc.).

This reduces main/index.ts by ~600 lines (1270 → 670) and adds 15 new tests covering forwarding, error, and stats listeners.
2026-01-29 15:26:43 -05:00
Pedram Amini
aed9fb7c95 dropped Aider across the code base and documentation 2026-01-28 20:35:13 -05:00
Pedram Amini
b25419d74e version bump 2026-01-28 20:00:32 -05:00
Pedram Amini
6c5f0a103c docs(prompt): prefer subdirectories for multi-phase Auto Run documents
When creating 3+ phase documents for a single effort, agents should now place them in a dedicated subdirectory for easier organization and batch addition.
2026-01-28 17:44:21 -05:00
Pedram Amini
6477d0fafb fix(synopsis): use full synopsis prompt to prevent preamble caveats
The automatic synopsis triggered on process exit was using a short
hardcoded prompt that didn't include anti-caveat instructions. This
caused the agent to add unhelpful preambles like "I don't have any
record of previous work in this session" in toast notifications.

Now uses autorunSynopsisPrompt which includes instructions to jump
straight to the accomplishment without session context caveats.
2026-01-28 14:17:03 -05:00
Pedram Amini
4268b79a58 feat(thinking): add three-state thinking toggle (off/on/sticky)
Implements #165 - adds a third "sticky" mode for the thinking toggle
that keeps thinking content visible after the response completes.

- Add ThinkingMode type ('off' | 'on' | 'sticky') to shared types
- Update settings modal with three-position toggle button group
- Update thinking pill UI to show pin icon for sticky mode
- Update Cmd+Shift+K to cycle through all three states
- Add visual differentiation: off (dim), on (accent), sticky (warning+pin)
- Maintain backward compatibility for legacy boolean settings

Closes #165
2026-01-28 12:42:47 -05:00
Pedram Amini
fcd31ff74d fix(factory-droid): address PR #225 review issues
- Remove unrelated husky and lint-staged dev dependencies
- Fix Windows path encoding in session storage (handle backslashes)
- Add debug logging to empty catch blocks for better diagnostics
- Add type guard validation for JSON parsing in output parser
2026-01-27 13:42:16 -06:00
Pedram Amini
b0ace1b753 Merge commit 'refs/pull/225/head' of https://github.com/pedramamini/Maestro into 0.15.0-rc 2026-01-27 13:33:14 -06:00
Pedram Amini
2af7f56178 Merge commit 'refs/pull/188/head' of https://github.com/pedramamini/Maestro into 0.15.0-rc 2026-01-27 13:22:50 -06:00
Pedram Amini
edd41fd7e2 Merge remote-tracking branch 'origin/token-donations' into 0.15.0-rc
# Conflicts:
#	docs/releases.md
2026-01-27 08:20:43 -06:00
Pedram Amini
49a94d4cfb addressed bugs in context consumption calculation 2026-01-27 08:19:14 -06:00
chr1syy
b803f2230c fix(indentation) 2026-01-27 13:00:14 +01:00
chr1syy
4a2ba89b4e Fix(git) remote git repo detection: always pass working directory for remote git IPC handlers
- Ensure remoteCwd is set for all remote git operations (isRepo, status, diff, branch, remote, numstat, tags, branches, info)
- Resolves warning about missing remote working directory
- Enables correct git repo detection and status for remote directories in wizard and agent flows
2026-01-27 12:12:18 +01:00
chr1syy
a21185a7e5 fix(ssh): robust remote agent execution, synopsis, and wizard handling
- Ensure prompts for remote SSH agents are sent via stdin as JSON in stream-json mode, fixing agent crashes with large prompts
- Always run background synopsis (history tab) on the correct remote host by propagating SSH config from the main session
- Improve wizard error handling: treat nonzero agent exit codes as success if output parses as a valid response, preventing false error states in confidence-building chat
- General reliability improvements for remote agent session management and output parsing
2026-01-27 11:37:21 +01:00
chr1syy
ac391a35fa fix(ssh): reverted to $SHELL for portability, added different bash profile sourcing 2026-01-26 23:34:45 +01:00
Pedram Amini
fb8270efa3 fix: align registerActive handler with preload API signature
The handler expected documentPaths[] but preload/App.tsx send totalDocuments.
Changed handler to accept totalDocuments directly since only the count is needed.
2026-01-26 15:36:35 -06:00
Pedram Amini
d8e455535a fix: add Symphony keyboard shortcut and command palette entry
Add the Symphony hotkey (⌘⇧Y) and command palette entry that were lost
during the rebase. Changes include:
- Add onOpenSymphony to QuickActionsModalProps and command palette actions
- Add onOpenSymphony prop chain through AppModals to App.tsx
- Add setSymphonyModalOpen to keyboard handler context
- Add openSymphony shortcut handler in useMainKeyboardHandler
2026-01-26 15:32:50 -06:00
chr1syy
d9c1c2bba0 fix(synopsis): removed unnecessary variable, synopsis functionality called ssh correctly 2026-01-26 22:28:37 +01:00
Pedram Amini
9659b3facf test: add Symphony mocks and fix SessionList test icons
- Add symphony API mock to test setup (getRegistry, getIssues, getState, etc.)
- Add Music and Server icons to SessionList test mocks
- Add setSymphonyModalOpen prop to SessionList test defaults

All 16,138 tests now pass.
2026-01-26 15:09:35 -06:00
Pedram Amini
0ecdbd4138 fix: pass url as object to symphony:fetchDocumentContent handler
The handler expects { url: string } but preload was passing just the
url string directly. This caused "Invalid URL" errors when trying to
preview document content.
2026-01-26 15:05:06 -06:00
chr1syy
2cd2716023 fix(quality): indentation fixes 2026-01-26 22:04:52 +01:00
Pedram Amini
d8b9ff9abf fix: register Symphony IPC handlers in main process
The Symphony handlers were defined but never called in src/main/index.ts.
Added import and invocation of registerSymphonyHandlers with app and
getMainWindow dependencies.
2026-01-26 15:00:16 -06:00
chr1syy
61bae47620 fix(log): replaced console.log with logging functions 2026-01-26 21:58:18 +01:00
Pedram Amini
da44c2e1f5 fix: restore SymphonyModal rendering in App.tsx
- Import SymphonyModal and SymphonyContributionData
- Add SymphonyModal component with full onStartContribution handler
- Add symphonyMetadata to Session interface in types/index.ts
- Import and re-export SymphonySessionMetadata from shared types
- Fix registerActive call to use totalDocuments instead of documentPaths
- Fix setRightPanelTab to setActiveRightTab
2026-01-26 14:54:51 -06:00
Pedram Amini
f772a1fde1 fix: add Maestro Symphony button to hamburger menu
- Added Music icon import to SessionList.tsx
- Added setSymphonyModalOpen to HamburgerMenuContentProps
- Added Symphony button between Usage Dashboard and divider
- Updated SessionListProps with setSymphonyModalOpen
- Updated useSessionListProps hook to pass Symphony setter
- Extracted symphonyModalOpen from ModalContext in App.tsx
2026-01-26 14:47:07 -06:00
chr1syy
e5ecaccdd0 fix(ts): fixed typescript errors 2026-01-26 18:44:28 +00:00
chr1syy
5f9eff09d7 fix(tests): fixed failing tests 2026-01-26 13:05:23 +00:00
chr1syy
7be4577ab6 fix(agents): agent arg building, grooming 2026-01-26 13:03:59 +00:00
chr1syy
aafe0d6a48 fix(windows): stabilize local and SSH execution for wizard and sessions
- Use full agent path (claude.exe) on Windows to avoid shell:true
  which breaks stdin piping for stream-json input mode
- Fix SSH condition to check enabled flag, not just config existence
- Pass sessionSshRemoteConfig through inline wizard to enable remote execution
- Add synopsis SSH inheritance from parent session as backend workaround

Fixes local wizard crashing with exit code 1 and SSH sessions
incorrectly using local paths when SSH was disabled.
2026-01-26 13:01:44 +00:00
chr1syy
98b5a05f56 fix(build): ensure Windows build stability by adding Python with distutils and resolving TypeScript errors
- Added Python 3.11 to Windows CI to restore distutils support required by node-gyp
- Ensured native module rebuilds (better-sqlite3, node-pty) succeed on Windows runners
- Fixed TypeScript build errors to restore clean compilation across all platforms
2026-01-26 12:51:32 +00:00
Pedram Amini
dca51447fd fix(ssh): stabilize SSH remote execution across wizard, file browser, and process manager
- Added extensive DEBUG-level logging for SSH command execution, spawn details, exit codes, and configuration flow
- Improved Wizard SSH remote support:
  - Debounced remote directory validation to reduce excessive SSH calls
  - Fixed git.isRepo() to correctly pass remoteCwd for remote checks
  - Persisted SSH config in SerializableWizardState and validated directories over SSH
  - Ensured ConversationScreen and ConversationSession consistently pass SSH config for remote agent execution
  - Fixed "agent not available" errors by forwarding stdin via exec and enabling stream-json mode for large prompts
- Enhanced remote agent execution logic in ProcessManager with stdin streaming, exec-based forwarding, and useStdin flag
- Improved SSH file browser behavior:
  - Added resolveSshPath() to locate SSH binaries on Windows (Electron spawn PATH issue)
  - Corrected getSshContext() handling of enabled/remoteId states
  - Ensured synopsis background tasks run via SSH instead of local paths
- Added Windows development improvements: dev:win script and PowerShell launcher for separate renderer/main terminals
- Added additional SSH directory debugging logs for remote-fs and wizard flows

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:48:41 +00:00
chr1syy
ab7bf27d03 fix(ssh): stabilize and complete SSH remote execution support across wizard, IPC, and agent detection
- Added full SSH remote support to the wizard, including propagation of SSH config through all phases
- Ensured SSH config flows correctly through IPC bridge (renderer → preload → main)
- Improved agent detection with optional sshRemoteId and remote `which` resolution
- Fixed SSH config transfer during manual agent creation and auto-selection flows
- Added extensive debugging and structured logging for SSH execution, agent availability, and wizard message flow
- Improved stdin/JSON streaming for large prompts and remote execution
- Added input/output JSON stream handling and enhanced logging for SSH transport
- Added sourcing of bash profiles to correctly resolve claude-code binary paths on remote hosts
2026-01-26 12:38:50 +00:00
Pedram Amini
b37f1b3475 fix: respect scroll position in AI mode - don't auto-scroll when user scrolls up
Removes the unconditional auto-scroll effect that snapped users back to
the bottom whenever new messages arrived, even when they had scrolled up
to review earlier output. TerminalOutput.tsx already handles scroll
behavior correctly: terminal mode auto-scrolls, AI mode shows a "New
Messages" button when scrolled up.

Closes issue #237
2026-01-25 23:50:23 -06:00
Pedram Amini
270cfd9fe1 fix: speckit/openspec commands now accept arguments (#238)
Slash commands like `/speckit.plan Blah blah blah` now correctly parse
the base command and arguments. The arguments are stored in QueuedItem
and substituted for $ARGUMENTS in prompt templates when executed.

- Parse command text into base command and args in useInputProcessing
- Add commandArgs field to QueuedItem interface
- Substitute $ARGUMENTS in prompts before template variable substitution
- Add comprehensive test cases for argument parsing
2026-01-25 23:08:00 -06:00
Pedram Amini
e698e54dd0 integration tests for web interface 2026-01-25 22:56:11 -06:00
Pedram Amini
3b55fbdd41 bugfix in web interface sync 2026-01-25 22:55:57 -06:00
github-actions[bot]
1f938021fb docs: sync release notes for v0.14.5 2026-01-24 11:15:48 +00:00
Kayvan Sylvan
965a049400 fix: make dev server port configurable via VITE_PORT environment variable (#234)
## CHANGES

- Extract dev server port and URL into separate variables
- Add radix parameter to `parseInt` for proper number parsing
- Sync port configuration between Vite config and main process
- Use consistent port parsing with explicit base 10 radix
2026-01-24 05:03:09 -06:00
Raza Mair
93cf4c71ff Merge pull request #230 from pedramamini/code-refactor
refactor: extract app lifecycle modules from main/index.ts
2026-01-23 16:01:18 -06:00
Raza Rauf
64d990ca3f fix: address code review feedback for Phase 4 refactor
- Use module-level flag instead of try-catch for IPC handler registration
- Improve error logging to capture full context with stack traces
- Add race condition protection for quit confirmation flow
2026-01-24 01:46:32 +05:00
Raza Rauf
434ee29bfb Merge branch 'main' into code-refactor 2026-01-24 00:02:13 +05:00
Pedram Amini
8be8a8eb6a fix: add Python 3.11 setup for Windows build (distutils removed in 3.12+) 2026-01-23 12:36:59 -06:00
github-actions[bot]
f87971f680 docs: sync release notes for v0.14.5 2026-01-23 13:41:20 +00:00