Skip to content

feat(llm): add OpenRouter API provider support#6

Merged
ngduyanhece merged 5 commits intomainfrom
feat/openrouter-provider
Jul 2, 2025
Merged

feat(llm): add OpenRouter API provider support#6
ngduyanhece merged 5 commits intomainfrom
feat/openrouter-provider

Conversation

@longle325
Copy link
Copy Markdown
Contributor

Description

What problem does this solve?

  • Enables Cipher to connect to 200+ AI models through OpenRouter's unified API.

How did you solve it?

  • Created OpenRouterService class.
  • Extended LLM configuration schema.
  • Enhanced service factory.
  • Added environment variable support.
  • Updated CLI validation.

Any breaking changes?

  • No breaking changes. All new features are backward compatible and opt-in.

Testing performed

  • Manual testing with OpenRouter API integration.
  • Verified tool calling works with MCP filesystem server.
  • Tested configuration validation and error handling.
  • Confirmed API key validation in CLI.
  • Validated proper headers are sent to OpenRouter API.
  • Tested model switching and reasoning loop functionality.
  • All tests pass.

@ngduyanhece ngduyanhece merged commit fd01284 into main Jul 2, 2025
@ngduyanhece ngduyanhece deleted the feat/openrouter-provider branch July 6, 2025 11:22
Ptah-CT pushed a commit to DerAuctor/ct-cipher that referenced this pull request Oct 2, 2025
feat(llm): add OpenRouter API provider support
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
29 tasks
RyanNg1403 added a commit that referenced this pull request Apr 13, 2026
Fixes applied (6):
- #1: Path traversal guard — safePath() validates all file paths stay
  within contextTreeDir before write/delete
- #2: SYNTHESIZE/UPDATE throws instead of deleting pre-existing file
  (previousTexts not captured for synthesize operations)
- #3: Remove unnecessary `as number` cast — TypeScript narrows
  log.completedAt after status checks
- #5: Manifest rebuild errors now reported in result.errors instead
  of silently swallowed
- #6: unlinkSafe() only swallows ENOENT, rethrows permission errors
- #9: Added test for SYNTHESIZE/UPDATE error path

Skipped (4):
- #4: lastDreamLogId intentionally NOT cleared — keeping it allows
  "Dream already undone" error which is more informative than
  "No dream to undo" on double-undo
- #7: resolveProject() fallback to cwd follows existing codebase
  pattern (curate/view.ts uses the same approach)
- #8: No exhaustiveness check in switch — silent no-op is correct
  for undo of unknown future operation types (safer than crashing)
- #10: No lastDreamLogId assertion in test — follows from #4 skip
@github-actions github-actions bot mentioned this pull request Apr 13, 2026
29 tasks
cuongdo-byterover added a commit that referenced this pull request Apr 14, 2026
Blocking (5 fixes):
- #1: Bound resolveUniqueFilename loop to MAX_SUFFIX=10000 with
  timestamp fallback (local-markdown-adapter)
- #2: Make GBrain bin resolution lazy — execFileSync no longer runs
  in constructor, deferred to first executor use
- #3: Replace execFileSync with async execFileAsync in config-validator
  (validateGBrain is now async)
- #4: Add MAX_ARG_LENGTH guard (200KB) in execBrvCurate to prevent
  E2BIG on large content
- #5: Bound memory-wiki store() filename loop with same pattern

Medium (6 fixes):
- #6: Remove unreachable 'creative' from QueryType union and
  SELECTION_MATRIX
- #8: Replace this.index! non-null assertions with explicit null
  guards in obsidian and local-markdown adapters
- #9: Fix byterover writeSupported: true → false in
  createDefaultCapabilities (matches adapter)
- #10: Replace 'as' type assertion with instanceof narrowing in
  execBrvCurate error handler
- #11: Replace 'as Error' assertions with instanceof checks in
  swarm curate and query CLI commands
- Stale JSDoc: remove 'creative' from router comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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