Skip to content

feat: /config command with source attribution#184

Merged
ChrisRomp merged 4 commits intomainfrom
feat/config-command
Apr 2, 2026
Merged

feat: /config command with source attribution#184
ChrisRomp merged 4 commits intomainfrom
feat/config-command

Conversation

@ChrisRomp
Copy link
Copy Markdown
Owner

Summary

Adds a /config slash command that displays the effective channel configuration as a table with source attribution, showing where each setting came from.

What it does

  • Shows merged config from all layers: defaults, config.json, dynamic channel, bot default, channel prefs, active session
  • Each row shows Setting, Value, and Source columns
  • Provider prefix only shown when the model actually came from channel prefs
  • Workspace and bot show "runtime" source when resolved at session level

Key changes

  • src/core/command-handler.ts: resolveEffectiveConfig(), formatConfigTable(), /config case
  • src/core/command-handler.test.ts: 18 new tests for resolver, formatter, and command integration
  • src/core/bridge-docs.ts: Added /config to commands topic

Example output

Channel Config -- #copilot
Source: config.json

| Setting         | Value              | Source          |
|:--|:--|:--|
| model           | `claude-opus-4.6` | session (active)|
| agent           | --                 | (not set)       |
| triggerMode     | `all`             | config.json     |
| verbose         | `Off`             | defaults        |
| permissionMode  | `interactive`     | defaults        |
| workspace       | `/path/to/ws`     | runtime         |
| bot             | `copilot`         | config.json     |

Shows the effective channel configuration as a table with a Source column
indicating where each setting came from (defaults, config.json, dynamic
channel, bot default, channel prefs, runtime, or active session).

- resolveEffectiveConfig() merges all config layers with attribution
- formatConfigTable() renders markdown table for chat
- Provider prefix only applied when model source is channel prefs
- Workspace/bot source correctly attributed across all value sources
- 18 new tests covering resolver logic and formatting
- Added to help text and bridge-docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 04:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new /config slash command to surface the effective (merged) channel configuration in chat as a markdown table, including a “Source” column indicating which layer supplied each value.

Changes:

  • Added resolveEffectiveConfig() to compute effective settings plus per-setting source attribution.
  • Added formatConfigTable() and wired /config into command dispatch and /help output.
  • Added test coverage for resolver/formatter behavior and basic command integration; updated bridge docs to list /config.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/core/command-handler.ts Implements effective-config resolver + formatter and adds /config command + help text.
src/core/command-handler.test.ts Adds unit/integration tests for /config, resolver attribution, and table formatting.
src/core/bridge-docs.ts Documents the new /config slash command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/command-handler.ts
Comment thread src/core/command-handler.ts
Prevents markdown injection from user-controlled channel pref values
containing pipe characters, newlines, or backticks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/core/command-handler.ts Fixed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 16:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/command-handler.ts
Comment thread src/core/command-handler.ts
- agent: null in channel prefs now treated as explicit deselect (matches
  session-manager getEffectivePrefs logic)
- Bot name resolved via getChannelBotName() to show platform default
  instead of literal 'default'
- 2 new tests for both cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ChrisRomp ChrisRomp merged commit d64cfa7 into main Apr 2, 2026
6 checks passed
@ChrisRomp ChrisRomp deleted the feat/config-command branch April 2, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants