Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 22, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

markijbema and others added 9 commits January 22, 2026 13:29
- Add logTelemetryEvent helper in TelemetryService for debug logging
- Log telemetry events to console when NODE_ENV=development
- Remove redundant console.log from AutocompleteTelemetry

This centralizes telemetry debugging in TelemetryService rather than
having scattered console.log calls in individual telemetry consumers.
- Add DebugTelemetryClient that logs all telemetry events to console
- Use DebugTelemetryClient in development mode for easier debugging
- Optionally also register PostHog if KILOCODE_POSTHOG_API_KEY is present
- Remove redundant logTelemetryEvent method from TelemetryService
feat: Add development-mode telemetry debug logging
* feat(agent-manager): add mode selection for CLI sessions

* refactor: extract shared useModeOptions hook to reduce duplication

Addresses PR review comment about duplication between ModeSelector and
SessionModeSelector. The shared hook builds mode dropdown options from
available modes, with optional translation support for the organization
modes header.

* fix: move css-prefix test to src directory for Node.js environment

* fix: isolate mode state per session in Agent Manager

- Add mode to CreateSessionOptions interface in AgentRegistry
- Store mode when creating sessions with DEFAULT_MODE_SLUG fallback
- Add mode to PendingProcessInfo interface in CliProcessHandler
- Pass mode through all session creation paths
- Remove global effectiveModeSlugAtom fallback in SessionModeSelector
- Each session now stores and uses its own mode independently

This fixes the bug where changing the mode in the new session form
would affect the displayed mode in all running sessions.

* fix: add onModeChanged callback to RuntimeProcessHandlerCallbacks and pass mode to createSession

* fix(agent-manager): pass customModes to agent process for organization modes

Organization modes were failing with 'KiloCode token + baseUrl is required
to fetch models' because the agent process didn't have access to the mode
configurations. This fix:

1. Adds customModes parameter to RuntimeProcessHandler.buildAgentConfig()
2. Adds customModes parameter to RuntimeProcessHandler.spawnProcess()
3. Updates AgentManagerProvider.spawnAgentWithCommonSetup() to fetch
   custom modes (including organization modes) and pass them to the
   agent process

Now the agent process receives all custom mode configurations at startup,
eliminating the need to fetch them from the API during runtime.

* fix(agent-manager): fix mid-session mode switching message format

The extension expects { type: 'mode', text: mode } webview messages,
not { type: 'setMode', mode }. Updated setSessionMode() to send the
correct message format via IPC.

* fix(agent-runtime): store customModes in globalState for organization modes

The CustomModesManager.getCustomModes() method reads organization modes from
globalState.get('customModes'). In agent processes, customModes were only
stored in the currentState but not in globalState, causing organization modes
to fail with 'KiloCode token + baseUrl is required to fetch models' error.

This fix stores customModes in globalState when the ExtensionHost initializes,
ensuring CustomModesManager can find organization modes in agent processes.

* fix(agent-manager): detect mode changes in state updates and call onModeChanged callback

The RuntimeProcessHandler was not detecting mode changes from state updates
sent by the agent process. This fix:
- Adds sessionModes map to track current mode for each session
- Detects mode changes in handleExtensionMessage when processing state updates
- Calls onModeChanged callback when mode changes are detected
- Cleans up sessionModes when sessions are terminated

* chore(agent-manager): add detailed logging for organization mode debugging

Added logging to trace custom modes flow:
- AgentManagerProvider: logs mode slugs and sources when fetching custom modes
- RuntimeProcessHandler: logs mode and custom modes in buildAgentConfig
- agent-runtime process.ts: logs custom modes received from parent
- ExtensionHost: logs custom modes storage in globalState

* fix(agent-runtime): use options.mode for initial state instead of hardcoded 'code'

The ExtensionHost was hardcoding mode to 'code' in the initial state instead
of using the mode passed via options. This fix:
- Adds 'mode' field to ExtensionHostOptions interface
- Passes mode from ExtensionServiceOptions to ExtensionHostOptions
- Uses options.mode (with 'code' fallback) in initial state
- Adds logging to show the initial mode being set

* chore: add detailed logging for API configuration debugging

* fix(agent-manager): address PR review comments

- Disable organization modes temporarily (require additional API config work)
- Use i18n for SessionModeSelector title
- Make previousMode optional in ModeChangedMessage interface
- Remove debug logging

* fix(agent-manager): add portal container for dropdown scrolling

* fix(ui): add overscroll-contain to dropdown for scroll wheel support

* fix(agent-manager): add overflow-y and overscroll-behavior to mode selector content

* Fix comment

* fix(agent-manager): restore mode when resuming sessions

When resuming a session, the mode was not being passed to spawnAgentWithCommonSetup,
causing the agent to always start in 'code' mode regardless of the original session mode.

Now the mode is properly restored from either:
1. sessionData.metadata.mode (from server)
2. session.mode (from local registry)

This ensures that when a user resumes a session that was started in a custom mode
(e.g., 'Brian Mode'), the agent will continue using that mode.

* fix(agent-manager): pass mode to registry when creating session for resume

The mode was being passed to buildAgentConfig (for the agent process) but not
to registry.createSession when creating a new session entry for a resume.
This caused the UI to show 'code' mode even though the agent was running
in the correct mode.

Now the mode is passed to both:
1. buildAgentConfig - for the agent process configuration
2. registry.createSession - for the UI session state
Fix enhance prompt etc with ChatGPT provider
@pull pull bot locked and limited conversation to collaborators Jan 22, 2026
@pull pull bot added the ⤵️ pull label Jan 22, 2026
@pull pull bot merged commit ce874e8 into CrazyForks:main Jan 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants