Skip to content

feat: implement config routes#116

Open
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-72-config-routes
Open

feat: implement config routes#116
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-72-config-routes

Conversation

@2witstudios
Copy link
Owner

Summary

  • Adds read-only Fastify route plugin (src/server/routes/config.ts) with three endpoints:
    • GET /api/config — returns agent configuration from config.yaml merged with defaults
    • GET /api/templates — lists templates with source tracking (local vs global), descriptions, and template variables
    • GET /api/prompts — lists prompts with deduplication across local/global directories, descriptions, and variables
  • Adds Fastify and @fastify/cors dependencies
  • 11 tests covering all three endpoints with mocked filesystem

Test plan

  • npm run typecheck passes
  • npm test — all 229 tests pass (22 files)
  • Config endpoint returns defaults when no config.yaml exists
  • Config endpoint merges user overrides with defaults
  • Templates endpoint returns source tracking and variable extraction
  • Prompts endpoint deduplicates local over global
  • Both templates and prompts handle missing directories gracefully

Closes #72

…rompts

Add read-only Fastify route plugin with three endpoints:
- GET /api/config — returns agent configuration from config.yaml
- GET /api/templates — lists templates with source tracking (local vs global)
- GET /api/prompts — lists prompts with deduplication across local/global

Closes #72
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 34deb69 and 15ef3b9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • package.json
  • src/commands/list.ts
  • src/commands/spawn.test.ts
  • src/core/prompt.test.ts
  • src/core/prompt.ts
  • src/server/routes/config.test.ts
  • src/server/routes/config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ppg/issue-72-config-routes

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.

- Extract listPromptsWithSource and enrichEntryMetadata to core/prompt.ts
  (eliminates duplication between commands/list.ts and routes/config.ts)
- Update commands/list.ts to use shared core/prompt.ts module
- Simplify routes/config.ts: remove duplicate types and inline logic
- Mock globalTemplatesDir/globalPromptsDir in route tests to prevent
  host filesystem leakage
- Close Fastify instances in afterEach for proper cleanup
- Fix dedup tests to exercise actual local-shadows-global behavior
- Add tests for global-only entries and invalid YAML error path
- Remove redundant shape-only test per TDD guidelines
- Add auth expectation comment to route plugin
- Add core/prompt.test.ts with 10 unit tests
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.

Implement config routes

1 participant