Skip to content

feat(providers): add 1min.ai provider - #11631

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
zero-executioner:feature/oneminai-provider
Aug 26, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
zero-executioner:feature/oneminai-provider

Conversation

@zero-executioner

Copy link
Copy Markdown
Contributor

Summary

Adds 1min.ai (docs.1min.ai) as a provider. It's a chat aggregator with a genuinely custom, non-OpenAI-compatible API:

  • One promptObject.prompt string per request instead of a messages array (multi-turn context is normally carried server-side via promptObject.conversationId, which requires a prior POST /api/conversations call and a stable conversation identity that stateless OpenAI-compatible clients don't provide)
  • Real Server-Sent Events (event:/data: framing, event types content/result/done/error) instead of raw text deltas or OpenAI-shaped chunks
  • An API-KEY auth header instead of Authorization: Bearer (confirmed from every literal code sample on their docs page — their own docs intro page says Authorization: Bearer elsewhere, which is incorrect for this endpoint)

OneMinAiExecutor translates both directions: flattens OpenAI message history into a labeled prompt transcript, translates their real SSE stream into standard chat.completion.chunk events, unwraps their nested aiRecord.aiRecordDetail.resultObject for non-streaming JSON, and maps errors through buildErrorBody. Registered under both oneminai and 1min aliases via the lazy-loading executor pattern (#11220).

Tool-calling, vision, and response_format are declared as unsupportedParams since the translation doesn't wire up 1min.ai's attachments/Asset API — flagged honestly rather than silently dropped.

Also fixes a pre-existing Windows-only bug in executor-map-golden.test.ts: new URL(import.meta.url).pathname produces a leading-slash path (/C:/Users/...) that double-prefixes the drive letter when resolved (C:\C:\Users\...), which made the golden snapshot test unable to run at all on Windows — confirmed by reproducing the identical failure on a clean checkout with none of this PR's changes applied. Fixed by switching to fileURLToPath, matching the existing pattern already used in tests/helpers/goldenSnapshot.ts.

Test plan

  • New unit tests (tests/unit/executor-oneminai.test.ts): registration, prompt-flattening (single message + multi-turn), non-streaming JSON translation, SSE streaming translation, error mapping — 6/6 pass
  • Live end-to-end validation against the real API with a real 1min.ai key, exercising the actual shipped OneMinAiExecutor class (not a mock): non-streaming, streaming, and multi-turn context flattening all produced correct responses
  • npm run lint — 0 problems in changed files
  • npm run check:any-budget:t11 — pass
  • npm run check:tracked-artifacts — pass
  • npm run build — succeeds
  • Golden snapshot (executor-map-golden.test.ts) regenerated (UPDATE_GOLDEN=1) against the current branch tip — diff is exactly the two new aliases (oneminai, 1min) plus the keyCount bump, both golden assertions pass
  • Branch rebased onto the current tip of release/v3.8.51 immediately before opening this PR (single commit, verified HEAD~1 == upstream tip)

🤖 Generated with Claude Code

1min.ai (docs.1min.ai) is a chat aggregator with a custom, non-OpenAI-
compatible API: a single promptObject.prompt string instead of a
messages array, real SSE (event:/data:) instead of raw text deltas,
and an "API-KEY" auth header instead of Authorization: Bearer.

Adds a full OneMinAiExecutor translating both directions (message-
history flattening, SSE-to-OpenAI-chunk streaming, JSON response
unwrapping, error mapping via buildErrorBody), registered under both
`oneminai` and `1min` aliases, plus the registry entry, dashboard
metadata, static model catalog wiring, and an API-key validator.
Tool-calling/vision/response_format are declared unsupported since
the translation doesn't wire up 1min.ai's attachments/Asset API.

Validated against the live API with a real key: non-streaming,
streaming, and multi-turn context flattening all produce correct
responses.

Also fixes a pre-existing Windows-only bug in
executor-map-golden.test.ts (new URL(import.meta.url).pathname
produces a leading-slash path that double-prefixes the drive letter
when resolved) by switching to fileURLToPath, matching the existing
pattern in tests/helpers/goldenSnapshot.ts. This was blocking the
golden snapshot from running/regenerating at all on Windows,
independent of this change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@diegosouzapw
diegosouzapw merged commit 8abcd63 into diegosouzapw:release/v3.8.51 Aug 26, 2026
3 checks passed
diegosouzapw added a commit that referenced this pull request Aug 26, 2026
…11636)

Merged via /merge-batch (correção de lacuna, 2026-08-26). check:file-size confirmado OK após o rebaseline.
diegosouzapw added a commit to ntdatt812/OmniRoute that referenced this pull request Sep 10, 2026
check:file-size freezes src/shared/constants/providers/apikey/gateways.ts at
1462 lines, so a new catalog entry fails the gate on arrival. This PR's entry
and diegosouzapw#13025's take it to 1502 together.

Annotated rather than split: the file is declarative provider data, already
divided into six family files under apikey/, and every previous gateway entry
took the same route (diegosouzapw#11786 seekai, diegosouzapw#10987 logfare, diegosouzapw#10668 tabitoken, diegosouzapw#10531
freebuff, diegosouzapw#11631 1min.ai). Splitting a catalog for two entries would break the
semantic-families rule instead of helping.

The bump covers both entries because they land in the same batch.
diegosouzapw pushed a commit that referenced this pull request Sep 10, 2026
Merged with a rebaseline commit added on top of your branch: check:file-size freezes the gateways catalog at 1462 lines, so any new entry fails the gate on arrival. The annotation covers this entry and EURouter's (#13025) together, following the route every previous gateway entry took (#11786 seekai, #10987 logfare, #10668 tabitoken, #10531 freebuff, #11631 1min.ai) — the file is declarative data already split into six family files, so splitting it for two entries would break the semantic-families rule.

Validated in a combined worktree with 13 sibling PRs: 132 focused tests pass, typecheck:core clean, file-size green after the rebaseline.

Thank you for stating plainly what you did not verify. "The endpoint exists and is key-gated; catalog, streaming and tool calls not exercised" is worth more than a confident entry that turns out to be guesswork, and the conservative entry that follows from it — empty models, no capability declared, hasFree false with the billing shape spelled out — is exactly right.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). Boarded no worktree combinado junto com outras ~20 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e 292 testes focados (unit) + 18 (vitest) passando. Obrigado pela contribuição.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…apw#11631/diegosouzapw#11628 growth (diegosouzapw#11636)

Merged via /merge-batch (correção de lacuna, 2026-08-26). check:file-size confirmado OK após o rebaseline.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ouzapw#13024)

Merged with a rebaseline commit added on top of your branch: check:file-size freezes the gateways catalog at 1462 lines, so any new entry fails the gate on arrival. The annotation covers this entry and EURouter's (diegosouzapw#13025) together, following the route every previous gateway entry took (diegosouzapw#11786 seekai, diegosouzapw#10987 logfare, diegosouzapw#10668 tabitoken, diegosouzapw#10531 freebuff, diegosouzapw#11631 1min.ai) — the file is declarative data already split into six family files, so splitting it for two entries would break the semantic-families rule.

Validated in a combined worktree with 13 sibling PRs: 132 focused tests pass, typecheck:core clean, file-size green after the rebaseline.

Thank you for stating plainly what you did not verify. "The endpoint exists and is key-gated; catalog, streaming and tool calls not exercised" is worth more than a confident entry that turns out to be guesswork, and the conservative entry that follows from it — empty models, no capability declared, hasFree false with the billing shape spelled out — is exactly right.
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