Skip to content

Comments

Fix: skips model attempts if API key is not present#67

Merged
steipete merged 1 commit intosteipete:mainfrom
zaydiscold:fix/daemon-skip-models-without-api-keys
Feb 13, 2026
Merged

Fix: skips model attempts if API key is not present#67
steipete merged 1 commit intosteipete:mainfrom
zaydiscold:fix/daemon-skip-models-without-api-keys

Conversation

@zaydiscold
Copy link
Contributor

The Daemon Chat and Agent endpoints were selecting the first available model candidate without checking if the required API key exists. This caused immediate failures when a provider was first in the list but missing a key. Both endpoints now check for envHasKey() before selecting a model, allowing for proper fallback.

First clawdtribution :)

The Daemon Chat and Agent endpoints were selecting the first available model candidate without checking if the required API key exists. This caused immediate failures when a provider was first in the list but missing a key. Both endpoints now check for envHasKey() before selecting a model, allowing for proper fallback.

First clawdtribution :)
@steipete steipete merged commit 055070d into steipete:main Feb 13, 2026
1 check passed
steipete added a commit that referenced this pull request Feb 13, 2026
* feat: support API keys in config file (~/.summarize/config.json)

Add an 'apiKeys' section to the config file so API keys can be stored
persistently without polluting the shell environment:

  {
    "apiKeys": {
      "openai": "sk-...",
      "anthropic": "sk-ant-...",
      "google": "...",
      "openrouter": "sk-or-...",
      "xai": "...",
      "zai": "...",
      "apify": "...",
      "firecrawl": "...",
      "fal": "..."
    }
  }

Precedence: environment variables > config file apiKeys.
This maintains full backward compatibility.

Supported providers: openai, anthropic, google, xai, openrouter, zai,
apify, firecrawl, fal.

Closes #59

* chore(deps): update workspace dependencies

* fix: allow --extract for local media files (#72)

* fix: allow --extract for local media files

The --extract guard rejected all non-URL inputs, but local audio/video
files already have full extract support in summarizeMediaFile. Relax the
check to only block non-media local files (e.g. .txt, .pdf).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: assert media transcription path for --extract local media

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>

* style: format extract local-media guard

* test: stabilize flaky extension e2e mode checks

* test: stabilize sidepanel slide e2e assertions

* test: stabilize extension e2e tab-switch assertions

* test: harden extension mode-switch e2e flow

* feat: add Groq Whisper transcription as preferred cloud provider (#71)

* feat: add Groq Whisper transcription as preferred cloud provider

Add Groq (whisper-large-v3-turbo) as the first provider in the
transcription fallback chain. Groq offers fast, free transcription
via an OpenAI-compatible API.

New priority: Groq → ONNX → whisper.cpp → OpenAI → FAL

- Add groq.ts provider calling api.groq.com/openai/v1/audio/transcriptions
- Wire GROQ_API_KEY through CLI, daemon, and all transcript providers
- Include ffmpeg retry fallback on format errors (same as OpenAI path)
- Update provider hints and progress display for Groq variants

* style: fix biome formatting for groq integration

* test: add Groq transcription provider coverage tests

Cover Groq branches: success, fallback to OpenAI, empty text,
format retry via ffmpeg, null filename, error truncation, and
shouldRetryGroqViaFfmpeg. Brings branch coverage above 75% threshold.

* fix: tighten groq fallback flow and terminal errors

* docs: thank @n0an in changelog for pr #71

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>

* fix: support binary-safe stdin piping (#76)

* docs: add testing lessons learned for development workflow

* feat: add stdin support for CLI using temp-file approach

- Extend InputTarget type to include { kind: 'stdin' }
- Add resolveInputTarget handling for '-' input
- Implement stdin processing in runCli with temp file cleanup
- Update help text to document stdin support
- Add comprehensive tests for stdin functionality
- Follow existing error handling patterns
- Reuse handleFileInput logic for minimal changes

* refactor(stdin): address code review feedback

- Fix import duplication: use fs.readFile consistently
- Optimize Buffer handling in streamToString function
- Fix edge case: check for existing file named '-' before treating as stdin
- Add test file cleanup with afterAll hook
- Add streaming size limit check to prevent OOM (50MB max)
- Update README with stdin documentation and examples
- Add stdin examples to CLI help text
- Improve error messages for stdin size limits

* fix: address CodeRabbit code review feedback

- Fix help text: change --length bullet to valid --length short preset
- Add stdin to RunEnv type for dependency injection
- Use injected stdin from RunEnv instead of hardcoded process.stdin
- Handle false return from handleFileInput with explicit error
- Add random suffix to temp file name for uniqueness
- Fix fragile test assertion to properly verify stdin processing

* fix: improve UX for --extract with stdin error message

- Add stdin-specific error message when using --extract with piped input
- Update test to expect new error message
- Optimize streamToString to avoid redundant Buffer copying when chunk is already a Buffer

* docs: remove impractical examples and LESSONS_LEARNED.md

- Remove cat file.txt | summarize - example from help.ts and README.md
  (passing filename directly is more practical)
- Remove curl -s https://example.com | summarize - example
  (summarize can fetch URLs directly)
- Remove cat file.txt | summarize - from concise help
- Remove LESSONS_LEARNED.md (not intended for upstream)
- Keep pbpaste | summarize - as primary stdin example
  (this is the most useful real-world use case)

* feat: allow --markdown-mode llm for stdin/file inputs

- Update restriction to allow --markdown-mode llm for stdin and file inputs
- Reject other markdown modes (readability, auto, off) with clear error message
- Add tests for --markdown-mode llm allowance and other mode restrictions
- Error message indicates --markdown-mode llm transcript formatting is coming soon
- Follows CodeRabbit recommendation to support --markdown-mode llm use case

* fix: remove redundant --markdown-mode guard for file inputs

The third guard was contradicting the intended logic:
- First guard: Allow URL/file/stdin
- Second guard: Only allow llm mode for file/stdin
- Third guard (BUG): Rejected file inputs even with llm mode

Removed the redundant third guard since the first guard already restricts
to URL/file/stdin, making the third guard unreachable and buggy.

CodeRabbit issue: mvance#3 (comment)

* docs: refine messaging and fix error clarity

- Update README.md to remove 'file contents' from notes (removed examples)
- Fix awkward usage string in concise help: <url-or-file-or--> -> <input>
- Clarify --markdown-mode error message for file/stdin inputs
- Update test expectation for new error message

* test: update test to match new usage string

* ci: trigger workflow run

* ci: trigger workflow after enabling actions

* ci: trigger workflow run

* fix: support binary-safe stdin piping

* feat: support text and binary stdin input

* fix: restore transcribable extension helper export

---------

Co-authored-by: Matt Vance <mvance@pobox.com>

* test: add binary stdin routing integration coverage (#77)

* Fix: skips model attempts if API key is not present (#67)

The Daemon Chat and Agent endpoints were selecting the first available model candidate without checking if the required API key exists. This caused immediate failures when a provider was first in the list but missing a key. Both endpoints now check for envHasKey() before selecting a model, allowing for proper fallback.

First clawdtribution :)

* fix: use normalized env key checks in daemon auto fallback (#78)

* feat: support API keys in config file (~/.summarize/config.json)

Add an 'apiKeys' section to the config file so API keys can be stored
persistently without polluting the shell environment:

  {
    "apiKeys": {
      "openai": "sk-...",
      "anthropic": "sk-ant-...",
      "google": "...",
      "openrouter": "sk-or-...",
      "xai": "...",
      "zai": "...",
      "apify": "...",
      "firecrawl": "...",
      "fal": "..."
    }
  }

Precedence: environment variables > config file apiKeys.
This maintains full backward compatibility.

Supported providers: openai, anthropic, google, xai, openrouter, zai,
apify, firecrawl, fal.

Closes #59

* fix: support generic config env fallback (#63) (thanks @entropyy0)

---------

Co-authored-by: entropyy0 <entropyy0@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: fkbs <fbehrens@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Anton Novoselov <nantog@gmail.com>
Co-authored-by: Matt Vance <mvance@pobox.com>
Co-authored-by: zayd / cold <zaydkhan3@gmail.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