Skip to content

Add a whitelisted AI tool definition for Wave config updates#3070

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-tool-definition-for-wave-config
Draft

Add a whitelisted AI tool definition for Wave config updates#3070
Copilot wants to merge 4 commits intomainfrom
copilot/add-tool-definition-for-wave-config

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

This adds the missing AI tool definition for updating Wave configuration values, without wiring it into tool registration yet. The new tool mirrors the existing config write path (SetConfigCommand / SetBaseConfigValue) while constraining writes to an explicit whitelist instead of exposing the full settings surface.

  • New tool definition

    • Adds GetSetConfigToolDefinition() in pkg/aiusechat/tools_setconfig.go
    • Defines a strict set_config tool with:
      • structured config input payload
      • approval requirement before execution
      • callback that applies updates through wconfig.SetBaseConfigValue
  • Whitelisted config surface

    • Introduces an explicit allowlist of non-secret config keys
    • Excludes sensitive settings such as AI credentials and other unrestricted config writes
    • Encodes per-key schema and validation rules for:
      • booleans
      • numbers
      • strings
      • constrained enum values
      • null to remove/reset a setting
  • Validation behavior

    • Rejects unknown keys up front
    • Rejects values with incompatible types before reaching config write logic
    • Preserves wconfig.SetBaseConfigValue as the final write/typing path
  • Focused coverage

    • Adds unit tests for:
      • input parsing
      • whitelist enforcement
      • type/enum validation
      • callback write/remove behavior
      • emitted tool schema

Example tool shape:

func GetSetConfigToolDefinition() uctypes.ToolDefinition {
	return uctypes.ToolDefinition{
		Name:        "set_config",
		ToolLogName: "app:setconfig",
		InputSchema: map[string]any{
			"type": "object",
			"properties": map[string]any{
				"config": map[string]any{
					"type":                 "object",
					"additionalProperties": false,
				},
			},
			"required": []string{"config"},
		},
		ToolAnyCallback: setConfigCallback,
		ToolVerifyInput: verifySetConfigInput,
	}
}

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 3 commits March 15, 2026 21:47
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tool definition for modifying wave configuration values Add a whitelisted AI tool definition for Wave config updates Mar 15, 2026
Copilot AI requested a review from sawka March 15, 2026 21:51
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.

2 participants