Skip to content

Add REST GET /config endpoint to fetch agent configuration#1

Draft
Copilot wants to merge 14 commits intoget-configfrom
copilot/add-get-agent-config
Draft

Add REST GET /config endpoint to fetch agent configuration#1
Copilot wants to merge 14 commits intoget-configfrom
copilot/add-get-agent-config

Conversation

Copy link

Copilot AI commented Dec 8, 2025

Completed: Remove ConfigFile option and use ConfigPath instead

Summary

Removed the unnecessary ConfigFile option and updated the code to use the existing ConfigPath mechanism instead.

Changes Made:

  1. config_options.hpp: Removed DECLARE_CONFIGURATION(ConfigFile) declaration
  2. agent_config.cpp: Removed assignment of ConfigFile to options
  3. rest_service.cpp:
    • Changed PUT /config handler to use ConfigPath instead of ConfigFile
    • Gets first path from ConfigPath list (the config file's parent directory)
    • Updated skip logic to skip ConfigPath instead of ConfigFile

How it works:

  • AgentConfiguration automatically adds the config file's parent directory to the front of ConfigPath when loading config
  • RestService accesses the first element of ConfigPath to get the config directory
  • No new configuration option needed - uses existing infrastructure

Benefits:

  • Cleaner code - no duplicate config path tracking
  • Uses existing ConfigPath mechanism that's already passed to all sinks
  • More maintainable - one source of truth for config paths

Testing:

The PUT /config functionality continues to work as before:

  1. Gets config directory from first ConfigPath entry
  2. Writes updated config to config.json in that directory
  3. File monitoring detects change and triggers warm start
Original prompt

add a rest GET to fetch the agent config


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 6 commits December 8, 2025 20:34
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
… false

Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Copilot AI changed the title [WIP] Add REST GET to fetch agent config Add REST GET /config endpoint to fetch agent configuration Dec 8, 2025
Copilot AI requested a review from robot-ranger December 8, 2025 20:45
Copilot stopped work on behalf of robot-ranger due to an error March 22, 2026 21:56
Copilot AI and others added 6 commits March 22, 2026 22:01
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Agent-Logs-Url: https://github.com/robot-ranger/cppagent/sessions/b380bd2a-959a-4a64-b609-ccba032cdc20
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Agent-Logs-Url: https://github.com/robot-ranger/cppagent/sessions/b380bd2a-959a-4a64-b609-ccba032cdc20
Co-authored-by: robot-ranger <93950632+robot-ranger@users.noreply.github.com>
Agent-Logs-Url: https://github.com/robot-ranger/cppagent/sessions/049f148d-4f08-4985-8f03-040dc1a7392c
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