Skip to content

Feature: Add a file editor#779

Closed
gsxdsm wants to merge 13 commits intoAutoMaker-Org:v0.15.0rcfrom
gsxdsm:feat/file-editor
Closed

Feature: Add a file editor#779
gsxdsm wants to merge 13 commits intoAutoMaker-Org:v0.15.0rcfrom
gsxdsm:feat/file-editor

Conversation

@gsxdsm
Copy link
Collaborator

@gsxdsm gsxdsm commented Feb 17, 2026

Full featured file browser and editor

Summary by CodeRabbit

  • New Features
    • Added file search and content search across your project directory.
    • Added recurring schedule support for features with cron expressions and preset schedules.
    • Added Git integration including status viewing, diff display, and staging/unstaging changes.
    • Added comprehensive code editor with syntax highlighting, diff gutter, and editor settings.
    • Added Files view for browsing, editing, and managing project files.
    • Added Z.ai and Gemini API provider support with usage tracking.

@gsxdsm gsxdsm added Enhancement Improvements to existing functionality or UI. Testers-Requested Request for others to test an enhancement or bug fix/etc. Do Not Merge Use this label if something should not be merged. scope: ui UI/UX changes, layout, visual or interaction behavior. type: feature A new capability or functionality that does not exist yet. labels Feb 17, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Introduces recurring feature scheduling via cron expressions, new z.ai and Gemini provider integrations with usage tracking, a comprehensive file manager with editor and Git support, multiple API routes for filesystem and scheduling operations, and code editor configuration UI. Expands service layer, type definitions, and app store with supporting infrastructure.

Changes

Cohort / File(s) Summary
Scheduling Infrastructure
apps/server/src/services/scheduler-service.ts, apps/server/src/routes/schedule/*, libs/types/src/feature.ts
Introduces SchedulerService for orchestrating recurring features, new scheduling endpoints (validate, presets), FeatureSchedule type with crontab/nextRun, and 'scheduled' status to Feature and FeatureStatus unions.
Z.ai Integration (Backend)
apps/server/src/services/zai-usage-service.ts, apps/server/src/routes/zai/index.ts
New ZaiUsageService for fetching z.ai quota data with token management, API parsing, and multi-format response handling; routes for usage, status, configuration, and verification.
Gemini Integration (Backend)
apps/server/src/services/gemini-usage-service.ts, apps/server/src/routes/gemini/index.ts
New GeminiUsageService querying Google Cloud quota APIs with OAuth token handling and tier-based quotas; routes for usage retrieval and installation status detection.
Feature Creation/Updates with Scheduling
apps/server/src/routes/features/routes/create.ts, apps/server/src/routes/features/routes/update.ts
Integrated crontab parsing via CronExpressionParser; features can now have schedules with nextRun calculation on creation/update; duplicate-title validation removed.
Filesystem & Search Routes
apps/server/src/routes/fs/routes/{rename,git-status,git-diff,git-stage,search-files,search-content}.ts, apps/server/src/routes/fs/index.ts
Six new route handlers: file rename, git status/diff/stage operations with exec-based implementation, and dual-mode search (files with fuzzy matching, content with context/line matching).
Server Initialization & Port Management
apps/server/src/index.ts, apps/server/src/services/dev-server-service.ts
Added automatic port selection with findAvailablePort, SchedulerService initialization/lifecycle, new zai/gemini/schedule route mounting, and reserved-port guards to avoid conflicts.
Z.ai Integration (UI)
apps/ui/src/components/usage-popover.tsx, apps/ui/src/hooks/queries/use-usage.ts, apps/ui/src/components/views/settings-view/api-keys/hooks/*
New useZaiUsage hook with polling, z.ai usage display in popover and mobile bar, API key configuration UI, test/verify endpoints, and auth status management.
Gemini Integration (UI)
apps/ui/src/hooks/queries/use-usage.ts, apps/ui/src/components/usage-popover.tsx, apps/ui/src/hooks/use-provider-auth-init.ts
New useGeminiUsage hook, Gemini usage display (Flash/Pro quotas, auth method), auth initialization for Gemini CLI login detection, and multi-format response handling.
File Management UI
apps/ui/src/components/views/files-view.tsx, apps/ui/src/components/ui/file-tree.tsx, apps/ui/src/routes/files.tsx
Comprehensive FilesView component with file tree navigation, worktree/branch management, editor integration, Git status display, and keyboard shortcuts; FileTree with lazy-loading and context menus.
Code Editor Component
apps/ui/src/components/ui/code-editor.tsx, apps/ui/src/components/ui/file-search-dialog.tsx
CodeEditor using CodeMirror with syntax highlighting for 12+ languages, diff-gutter support, mobile optimization, and theme/keybinding configuration; FileSearchDialog with dual search modes (files/content) and debounced execution.
Editor Settings & Management
apps/ui/src/components/views/settings-view/editor/editor-section.tsx, apps/ui/src/store/app-store.ts, apps/ui/src/store/types/*
New EditorSection UI for font/size/ligatures/tab/wrap/fold/bracket settings; file editor store state (tabs, history, cursor, worktree context); auto-save configuration and defaults.
Scheduling UI
apps/ui/src/components/views/board-view/shared/schedule-selector.tsx, apps/ui/src/components/views/board-view/dialogs/{add-feature-dialog,edit-feature-dialog}.tsx
ScheduleSelector component with preset crontabs (hourly/daily/weekly/monthly) and custom validation; integrated into add/edit feature dialogs; next/last run display and context preservation toggle.
Feature Duplication
apps/ui/src/components/views/board-view/{board-view,kanban-card,kanban-board}.tsx, apps/ui/src/components/views/board-view/components/list-view/*
New handleDuplicateFeature action; propagated onDuplicate/onDuplicateAsChild callbacks through KanbanCard, ListView, and RowActions; submenu UI for duplicate operations across all feature statuses.
Scheduled Column & Status
apps/ui/src/components/views/board-view/{constants,hooks/*}.tsx, apps/ui/src/components/views/board-view/components/kanban-card/*
New 'scheduled' column in board view with empty state config; updated status ordering; scheduled features moved to in_progress when running; schedule badges and next-run display in card UI.
Type & Store Exports
libs/types/src/{feature,pipeline,ports,settings}.ts, apps/ui/src/store/{app-store,setup-store,types/*}.ts, apps/ui/src/lib/{electron,http-api-client}.ts
Extended type unions (FeatureStatus, FeatureStatusWithPipeline); new FeatureSchedule/SchedulePreset types; Z.ai/Gemini auth and usage types; file editor types; port registration utilities (registerRuntimePort, isAutomakerPort); Electron and HTTP API client extensions for new endpoints.
Package & Infrastructure
apps/server/package.json, apps/ui/package.json, start-automaker.sh, libs/prompts/src/defaults.ts
Added cron-parser dependency; CodeMirror language packages; watchdog process management for server restarts; updated port protection warnings in system prompts.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • Shironex

Poem

🐰 Hoppy times, the schedule hops along,
New z.ai and Gemini sing their song,
Files dance in trees, the editor glows bright,
A rabbit's dream of features done right!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gsxdsm gsxdsm closed this Feb 17, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gsxdsm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant upgrade to the application's core functionality by introducing a full-featured file editor and browser, complete with integrated Git capabilities. It also enhances automation by enabling recurring feature execution through a new scheduler service and expands AI provider support to include z.ai and Google Gemini. Furthermore, the server's stability is improved with dynamic port handling and a process watchdog.

Highlights

  • File Editor & Browser: Introduced a comprehensive file editor and browser, allowing users to view, edit, create, rename, and delete files directly within the application. This includes syntax highlighting for various languages, markdown preview, and file search capabilities.
  • Git Integration: Integrated Git functionality into the file editor, providing real-time Git status indicators in the file tree, inline diff gutters in the editor, and quick actions to stage/unstage files and view full diffs.
  • Feature Scheduling: Added a new scheduler service that enables features to be configured for recurring execution using cron expressions. Features can now be set to run hourly, daily, weekly, monthly, or on a custom schedule, with options to keep or clear prior agent context.
  • New AI Provider Integrations: Implemented usage tracking and API key management for z.ai and Google Gemini, expanding the range of supported AI models and providing users with better visibility into their API consumption.
  • Dynamic Port Allocation & Watchdog: Enhanced server robustness with dynamic port allocation to automatically find available ports on startup, and introduced a watchdog mechanism in the start-automaker.sh script to monitor and restart unresponsive server processes.
  • Feature Duplication: Added the ability to duplicate existing features, either as standalone features or as child features, streamlining the process of creating similar tasks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/server/package.json
    • Added 'cron-parser' dependency for schedule management.
  • apps/server/src/index.ts
    • Imported 'net' for port availability checks.
    • Imported 'registerRuntimePort' to track dynamically assigned ports.
    • Imported and registered new routes for z.ai, Gemini, and scheduling.
    • Instantiated 'SchedulerService' and 'ZaiUsageService'.
    • Implemented dynamic port finding logic to avoid 'EADDRINUSE' errors on server startup.
    • Started and stopped the scheduler service during server lifecycle events.
  • apps/server/src/routes/features/routes/create.ts
    • Imported 'CronExpressionParser' for schedule parsing.
    • Added logic to calculate 'nextRun' and set feature status to 'scheduled' if a recurring schedule is enabled during creation.
  • apps/server/src/routes/features/routes/update.ts
    • Imported 'CronExpressionParser' for schedule parsing.
    • Added logic to handle schedule updates, including calculating 'nextRun' and adjusting feature status based on schedule changes.
  • apps/server/src/routes/fs/index.ts
    • Imported and registered new file system routes: '/rename', '/git-status', '/git-diff', '/git-stage', '/search-files', and '/search-content'.
  • apps/server/src/routes/fs/routes/git-diff.ts
    • Added new route to retrieve Git diffs for a specified file or the entire repository, including parsing diff hunks.
  • apps/server/src/routes/fs/routes/git-stage.ts
    • Added new route to stage or unstage files in a Git repository.
  • apps/server/src/routes/fs/routes/git-status.ts
    • Added new route to retrieve the Git status of a repository, returning a list of changed files.
  • apps/server/src/routes/fs/routes/rename.ts
    • Added new route to rename or move files and directories, with path validation.
  • apps/server/src/routes/fs/routes/search-content.ts
    • Added new route to search file contents within a directory, supporting regex and file type filters.
  • apps/server/src/routes/fs/routes/search-files.ts
    • Added new route to perform fuzzy searches for files by name within a directory.
  • apps/server/src/routes/gemini/index.ts
    • Added new routes for Gemini API usage and status checks.
  • apps/server/src/routes/schedule/index.ts
    • Added new routes for validating crontab expressions and retrieving schedule presets.
  • apps/server/src/routes/schedule/routes/presets.ts
    • Added new route to provide predefined crontab schedule presets.
  • apps/server/src/routes/schedule/routes/validate.ts
    • Added new route to validate crontab expressions and return the next scheduled run time.
  • apps/server/src/routes/zai/index.ts
    • Added new routes for z.ai API usage, configuration, verification, and status checks.
  • apps/server/src/services/claude-usage-service.ts
    • Updated Claude CLI prompt detection patterns to support v2.x versions.
  • apps/server/src/services/dev-server-service.ts
    • Imported 'isAutomakerPort' to identify reserved ports.
    • Modified port killing logic to prevent terminating Automaker's own reserved ports.
  • apps/server/src/services/feature-loader.ts
    • Added logic to explicitly remove the 'schedule' field from feature JSON if it's undefined or null during an update.
    • Added 'deleteRawOutput' method to remove raw agent output files.
  • apps/server/src/services/gemini-usage-service.ts
    • Added new service to track Gemini CLI usage and quota by extracting OAuth credentials and querying Google Cloud APIs.
  • apps/server/src/services/scheduler-service.ts
    • Added new service to manage recurring feature schedules, including periodic checks, triggering feature execution, and updating schedule metadata.
  • apps/server/src/services/settings-service.ts
    • Added 'zai' API key to default credentials during migration.
  • apps/server/src/services/zai-usage-service.ts
    • Added new service to fetch and parse z.ai API usage quota data, supporting API token authentication.
  • apps/ui/package.json
    • Added multiple '@codemirror/lang-*' packages for extended language support in the code editor.
    • Added '@replit/codemirror-emacs' and '@replit/codemirror-vim' for alternative keybinding modes.
  • apps/ui/src/components/layout/sidebar/hooks/use-navigation.ts
    • Added 'FolderOpen' icon for the new Files view.
    • Included 'files' in navigation shortcuts and added 'Files' to the project section.
  • apps/ui/src/components/ui/code-editor.tsx
    • Added new CodeMirror-based code editor component with syntax highlighting, diff gutters, and configurable settings.
  • apps/ui/src/components/ui/file-search-dialog.tsx
    • Added new dialog component for fuzzy searching files and content within the project.
  • apps/ui/src/components/ui/file-tree.tsx
    • Added new file tree component with directory browsing, file operations (create, rename, delete), and Git status indicators.
  • apps/ui/src/components/ui/keyboard-map.tsx
    • Added 'files' to keyboard shortcut labels and categories.
  • apps/ui/src/components/ui/provider-icon.tsx
    • Added specific fill color for 'GlmIcon' (z.ai) and created 'ZaiIcon' alias.
  • apps/ui/src/components/usage-popover.tsx
    • Integrated 'ZaiIcon' and 'GeminiIcon' for usage display.
    • Added 'useZaiUsage' and 'useGeminiUsage' hooks for fetching usage data.
    • Included z.ai and Gemini tabs in the usage popover for detailed quota information.
    • Updated 'formatResetTime' to handle milliseconds and added 'formatNumber' for better display of large values.
  • apps/ui/src/components/views/board-view.tsx
    • Added 'handleDuplicateFeature' to board actions for duplicating features.
    • Updated 'KanbanCard' and 'ListView' props to support new duplication actions.
  • apps/ui/src/components/views/board-view/board-header.tsx
    • Integrated 'zaiAuthStatus' and 'geminiAuthStatus' to control usage popover visibility.
    • Updated usage popover visibility logic to include z.ai and Gemini.
  • apps/ui/src/components/views/board-view/components/kanban-card/agent-info-panel.tsx
    • Added an effect to clear 'taskStatusMap' when a feature is no longer running.
    • Adjusted logic to show simple model info for scheduled features that are not actively running.
  • apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx
    • Included 'scheduled' status in the conditions for displaying edit, spawn, and delete buttons.
    • Added a 'View Logs' button for scheduled features with prior runs.
  • apps/ui/src/components/views/board-view/components/kanban-card/card-badges.tsx
    • Added 'formatNextRun' helper function for schedule badge tooltips.
    • Introduced a 'CalendarClock' badge for scheduled features, displaying next run time in a tooltip.
  • apps/ui/src/components/views/board-view/components/kanban-card/card-content-sections.tsx
    • Added 'formatNextRunTime' helper function for displaying next run time on cards.
    • Displayed the next run time for scheduled features directly on the card content.
  • apps/ui/src/components/views/board-view/components/kanban-card/card-header.tsx
    • Added 'DropdownMenuSub' and 'Copy' icon for nested menu items.
    • Implemented duplicate and duplicate as child actions within the feature dropdown menus.
    • Adjusted conditions for displaying header actions for backlog and scheduled features.
  • apps/ui/src/components/views/board-view/components/list-view/list-view.tsx
    • Added duplicate and duplicate as child actions to the list view action handlers.
  • apps/ui/src/components/views/board-view/components/list-view/row-actions.tsx
    • Added duplicate and duplicate as child actions to row action handlers.
    • Updated the primary action label for scheduled features to 'Run Now'.
  • apps/ui/src/components/views/board-view/components/list-view/status-badge.tsx
    • Added 'scheduled' status to the status order for correct sorting.
  • apps/ui/src/components/views/board-view/constants.ts
    • Added an empty state configuration for the 'scheduled' column.
    • Defined a new 'Scheduled' column with a specific color class.
  • apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx
    • Integrated the 'ScheduleSelector' component for configuring recurring schedules.
    • Added 'schedule' field to 'FeatureData' and logic to handle its state and pass it to 'addFeature'.
  • apps/ui/src/components/views/board-view/dialogs/edit-feature-dialog.tsx
    • Integrated the 'ScheduleSelector' component for editing recurring schedules.
    • Added 'schedule' field to 'FeatureData' and logic to handle its state and pass it to 'updateFeature'.
  • apps/ui/src/components/views/board-view/header-mobile-menu.tsx
    • Updated usage bar visibility logic to include z.ai and Gemini authentication statuses.
  • apps/ui/src/components/views/board-view/hooks/use-board-actions.ts
    • Modified 'handleAddFeature' to set feature status to 'scheduled' if a schedule is enabled.
    • Updated 'handleForceStopFeature' to return scheduled features to 'scheduled' status upon stopping.
    • Implemented 'handleDuplicateFeature' to create copies of existing features.
  • apps/ui/src/components/views/board-view/hooks/use-board-column-features.ts
    • Added a 'scheduled' column to the board.
    • Adjusted logic to correctly place running scheduled features into the 'in_progress' column.
  • apps/ui/src/components/views/board-view/hooks/use-board-drag-drop.ts
    • Included 'scheduled' status in the drag-and-drop logic for features.
  • apps/ui/src/components/views/board-view/kanban-board.tsx
    • Added 'onDuplicate' prop to the Kanban board.
    • Implemented logic to dynamically filter out the 'scheduled' column if no features have active schedules.
  • apps/ui/src/components/views/board-view/mobile-usage-bar.tsx
    • Integrated z.ai and Gemini usage display into the mobile usage bar.
    • Added 'formatNumber' and 'formatResetTime' helpers for better display of usage data.
  • apps/ui/src/components/views/board-view/shared/index.ts
    • Exported 'schedule-selector' component.
  • apps/ui/src/components/views/board-view/shared/schedule-selector.tsx
    • Added new component for selecting and configuring feature schedules using crontab expressions and presets.
  • apps/ui/src/components/views/files-view.tsx
    • Added new 'FilesView' component, implementing the full-featured file editor and browser.
  • apps/ui/src/components/views/settings-view.tsx
    • Imported and rendered 'EditorSection' in the settings view.
  • apps/ui/src/components/views/settings-view/api-keys/hooks/use-api-key-management.ts
    • Added 'hasZaiKey' to 'ApiKeyStatus'.
    • Integrated z.ai API key management, including state, visibility toggles, and test connection functionality.
    • Updated 'handleSave' to configure z.ai service on the server and invalidate relevant queries.
  • apps/ui/src/components/views/settings-view/config/navigation.ts
    • Added 'FileCode2' icon for the editor settings.
    • Included 'editor' in the global navigation groups for settings.
  • apps/ui/src/components/views/settings-view/editor/editor-section.tsx
    • Added new settings section for configuring code editor appearance and behavior.
  • apps/ui/src/components/views/settings-view/hooks/use-settings-view.ts
    • Added 'editor' to 'SettingsViewId' type.
  • apps/ui/src/config/api-providers.ts
    • Added 'zai' to 'ProviderKey' type.
    • Included z.ai provider configuration in 'buildProviderConfigs'.
  • apps/ui/src/hooks/queries/index.ts
    • Exported 'useZaiUsage' and 'useGeminiUsage' hooks.
  • apps/ui/src/hooks/queries/use-usage.ts
    • Added 'useZaiUsage' hook for fetching z.ai API usage data.
    • Added 'useGeminiUsage' hook for fetching Gemini API usage/status data.
    • Updated error messages for Claude and Codex API bridge unavailability.
  • apps/ui/src/hooks/use-auto-mode.ts
    • Imported 'useQueryClient' and 'queryKeys'.
    • Added 'removeRunningTaskFromAllWorktrees' to state and actions.
    • Invalidated features query on 'auto_mode_feature_start' and 'auto_mode_feature_complete' events to ensure UI reflects status changes.
    • Modified 'stopFeature' to use 'removeRunningTaskFromAllWorktrees'.
  • apps/ui/src/hooks/use-provider-auth-init.ts
    • Imported z.ai and Gemini authentication types.
    • Integrated z.ai and Gemini authentication status initialization on app startup.
  • apps/ui/src/hooks/use-settings-sync.ts
    • Added 'fileEditorSettings' to 'SETTINGS_FIELDS_TO_SYNC'.
    • Included logic to sync 'fileEditorSettings' from server settings.
  • apps/ui/src/lib/electron.ts
    • Added new types for Git status, diff hunks, file search results, and content search results.
    • Extended 'ElectronAPI' with new methods for file system operations (rename, gitStatus, gitDiff, gitStage, searchFiles, searchContent).
    • Extended 'ElectronAPI' with z.ai and Gemini specific API methods.
    • Updated mock Electron API to include new file system, Git, z.ai, and Gemini functionalities.
  • apps/ui/src/lib/http-api-client.ts
    • Imported new Git and file search result types.
    • Extended 'HttpApiClient' with new methods for file system operations (rename, gitStatus, gitDiff, gitStage, searchFiles, searchContent).
    • Added z.ai and Gemini API client implementations.
  • apps/ui/src/lib/query-keys.ts
    • Added query keys for z.ai and Gemini API usage.
  • apps/ui/src/routes/files.tsx
    • Added new route definition for the '/files' path, rendering the 'FilesView' component.
  • apps/ui/src/store/app-store.ts
    • Imported new file editor and usage types.
    • Added new state properties for file editor tabs, active tab, history, settings, save status, and worktree selection.
    • Added new state properties for z.ai usage and last updated timestamp.
    • Implemented new actions for managing file editor tabs (open, close, set active, update content, mark saved, set cursor, set save status, auto-save settings, clear all, get active/dirty, reorder, set/get worktree).
    • Implemented 'setZaiUsage' action.
    • Implemented 'removeRunningTaskFromAllWorktrees' action to ensure tasks are removed across all worktrees.
  • apps/ui/src/store/defaults/constants.ts
    • Added constants for maximum file history entries, default auto-save interval, and default editor preferences (font size, tab size, line height).
  • apps/ui/src/store/defaults/index.ts
    • Exported new constants related to file editor defaults.
  • apps/ui/src/store/setup-store.ts
    • Added 'ZaiAuthMethod', 'ZaiAuthStatus', 'GeminiAuthMethod', and 'GeminiAuthStatus' types.
    • Added 'zaiAuthStatus' and 'geminiAuthStatus' to the setup state.
    • Added 'setZaiAuthStatus' and 'setGeminiAuthStatus' actions.
  • apps/ui/src/store/types/settings-types.ts
    • Added 'zai' to the 'ApiKeys' interface.
  • apps/ui/src/store/types/state-types.ts
    • Imported new file editor and usage types.
    • Added new state properties for file editor management (tabs, active tab, history, settings, save status, worktree selection).
    • Added 'zaiUsage' and 'zaiUsageLastUpdated' to the application state.
  • apps/ui/src/store/types/ui-types.ts
    • Added new types for file editor components: 'CursorPosition', 'FileHistoryEntry', 'OpenTab', 'EditorKeybindings', 'MarkdownPreviewMode', and 'FileEditorSettings'.
    • Added 'files' to the 'KeyboardShortcuts' interface.
  • apps/ui/src/store/types/usage-types.ts
    • Added new types for z.ai usage: 'ZaiPlanType', 'ZaiQuotaLimit', 'ZaiUsage', and 'ZaiUsageResponse'.
    • Added new types for Gemini usage: 'GeminiQuotaBucket', 'GeminiTierQuota', 'GeminiUsage', and 'GeminiUsageResponse'.
  • apps/ui/src/store/utils/shortcut-utils.ts
    • Added 'files' to 'DEFAULT_KEYBOARD_SHORTCUTS'.
  • apps/ui/src/styles/global.css
    • Added CSS variables for '--status-scheduled' color in both light and dark themes.
  • apps/ui/tests/files/git-integration.spec.ts
    • Added new Playwright E2E tests for Git integration in the Files view, covering status indicators, diff view, and staging/unstaging files.
  • libs/prompts/src/defaults.ts
    • Updated port protection messages in default prompts to reflect the dynamic range of reserved ports.
  • libs/types/src/feature.ts
    • Defined 'FeatureSchedule' interface for recurring feature configurations.
    • Defined 'SchedulePreset' type for UI options.
    • Added 'schedule' field to the 'Feature' interface.
    • Added 'scheduled' to the 'FeatureStatus' type.
  • libs/types/src/index.ts
    • Exported new types related to feature scheduling ('FeatureSchedule', 'SchedulePreset').
    • Exported new functions for port management ('registerRuntimePort', 'isAutomakerPort', 'getAutomakerPorts').
  • libs/types/src/pipeline.ts
    • Added 'scheduled' to 'FeatureStatusWithPipeline' type.
  • libs/types/src/ports.ts
    • Updated 'STATIC_PORT' and 'SERVER_PORT' descriptions to clarify they are default ports.
    • Implemented runtime port registration and checking to protect dynamically assigned ports.
    • Added 'getAutomakerPorts' function.
    • Made 'RESERVED_PORTS' a readonly array.
  • libs/types/src/settings.ts
    • Added 'zai' to the 'Credentials' interface and 'DEFAULT_CREDENTIALS'.
  • package-lock.json
    • Updated dependencies to include 'cron-parser' and various CodeMirror language extensions.
  • start-automaker.sh
    • Added watchdog configuration variables (enabled, check interval, max restarts, window seconds).
    • Updated cleanup function to kill watchdog and web server processes.
    • Implemented watchdog functionality to monitor and restart API and web servers if they become unresponsive, with rate limiting for restarts.
Activity
  • The pull request introduces a new 'Files' feature, a scheduler service, and integrations for z.ai and Gemini. No human activity (comments, reviews) is available in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant new feature: a full-featured file browser and editor. It also adds a task scheduling system, integrates with z.ai and Gemini for usage tracking, and improves server startup with automatic port conflict resolution. My review focuses on ensuring the new backend endpoints are secure and that existing functionality wasn't unintentionally removed. I've identified a critical security vulnerability related to command injection in the new git-related endpoints and a high-severity regression where duplicate feature title checks were removed. There are also some suggestions for improving type safety.

Comment on lines +30 to +35
const diffCmd = filePath ? `git diff HEAD -- "${filePath}"` : 'git diff HEAD';

const { stdout: diff } = await execAsync(diffCmd, {
cwd: repoPath,
maxBuffer: 10 * 1024 * 1024,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Using exec with user-provided input (filePath) can open the door to command injection vulnerabilities. Even with quoting, it's safer to use execFile, which does not spawn a shell and treats arguments as separate tokens. Please update this to use execFile for improved security.

You will also need to update the import from child_process and the promisified function.

Suggested change
const diffCmd = filePath ? `git diff HEAD -- "${filePath}"` : 'git diff HEAD';
const { stdout: diff } = await execAsync(diffCmd, {
cwd: repoPath,
maxBuffer: 10 * 1024 * 1024,
});
const args = ['diff', 'HEAD'];
if (filePath) {
args.push('--', filePath);
}
const { stdout: diff } = await execFileAsync('git', args, {
cwd: repoPath,
maxBuffer: 10 * 1024 * 1024,
});

Comment on lines +43 to +46
const cmd =
action === 'stage' ? `git add -- "${filePath}"` : `git reset HEAD -- "${filePath}"`;

await execAsync(cmd, { cwd: repoPath });
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Similar to the git-diff endpoint, using exec with user-provided filePath is a security risk. To prevent potential command injection, please switch to using execFile. This is a safer alternative as it does not invoke a shell.

Remember to update the child_process import and the promisified function accordingly.

Suggested change
const cmd =
action === 'stage' ? `git add -- "${filePath}"` : `git reset HEAD -- "${filePath}"`;
await execAsync(cmd, { cwd: repoPath });
const args =
action === 'stage' ? ['add', '--', filePath] : ['reset', 'HEAD', '--', filePath];
await execFileAsync('git', args, { cwd: repoPath });

success: false,
error: `A feature with title "${feature.title}" already exists`,
duplicateFeatureId: duplicate.id,
// Calculate nextRun and set status to 'scheduled' if schedule is provided and enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The logic to check for and prevent duplicate feature titles appears to have been removed in this change. This could lead to multiple features having the same name, causing confusion. This check should be restored.

      // Check for duplicate title if title is provided
      if (feature.title && feature.title.trim()) {
        const duplicate = await featureLoader.findDuplicateTitle(projectPath, feature.title);
        if (duplicate) {
          res.status(409).json({
            success: false,
            error: `A feature with title "${feature.title}" already exists`,
            duplicateFeatureId: duplicate.id,
          });
          return;
        }
      }

      // Calculate nextRun and set status to 'scheduled' if schedule is provided and enabled

}
}

// Get the current feature to detect status changes
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The logic to check for duplicate feature titles during an update seems to have been removed. This is important to prevent renaming a feature to a title that is already in use by another feature. Please restore this validation.

      // Check for duplicate title if title is being updated
      if (updates.title && updates.title.trim()) {
        const duplicate = await featureLoader.findDuplicateTitle(
          projectPath,
          updates.title,
          featureId // Exclude the current feature from duplicate check
        );
        if (duplicate) {
          res.status(409).json({
            success: false,
            error: `A feature with title "${updates.title}" already exists`,
            duplicateFeatureId: duplicate.id,
          });
          return;
        }
      }

      // Get the current feature to detect status changes

Comment on lines +41 to +51
(status as any).authMethod ||
(status.authenticated ? (status.hasApiKey ? 'api_key' : 'cli_login') : 'none');

res.json({
success: true,
installed: status.installed,
version: status.version || null,
path: status.path || null,
authenticated: status.authenticated || false,
authMethod,
hasCredentialsFile: (status as any).hasCredentialsFile || false,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The use of (status as any) to access properties like authMethod and hasCredentialsFile indicates that the type of the status object is not fully defined. This reduces type safety and makes the code harder to maintain.

Please consider defining a more specific type for the object returned by provider.detectInstallation() that includes these optional properties. This will provide better autocompletion and prevent potential runtime errors if the object structure changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Use this label if something should not be merged. Enhancement Improvements to existing functionality or UI. scope: ui UI/UX changes, layout, visual or interaction behavior. Testers-Requested Request for others to test an enhancement or bug fix/etc. type: feature A new capability or functionality that does not exist yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments