Skip to content

Add Crater ForgeFed OpenAI compatibility provider#34

Merged
konard merged 2 commits into
mainfrom
issue-33-11cc347ca557
May 12, 2026
Merged

Add Crater ForgeFed OpenAI compatibility provider#34
konard merged 2 commits into
mainfrom
issue-33-11cc347ca557

Conversation

@konard

@konard konard commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add UPSTREAM_PROVIDER=crater with CRATER_FORGEFED_INBOX, actor, target, and poll configuration
  • translate OpenAI chat completion requests into ForgeFed Offer activities containing Ticket objects, parse Accept.result, poll task URIs until resolution, and map results back to OpenAI-compatible JSON or SSE
  • introduce the async TaskProvider trait so the Crater backend can be swapped without changing the HTTP route layer
  • document Crater setup and add a changelog fragment

Reproduce / Verify

  1. Start the router with a Crater inbox, for example:
    UPSTREAM_PROVIDER=crater \
    CRATER_FORGEFED_INBOX=https://tracker.example/inbox \
    link-assistant-router serve
  2. POST OpenAI-style chat JSON to /v1/chat/completions.
  3. Use either body "stream": true or /v1/chat/completions?stream=true to receive SSE chunks.

Tests

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --verbose
  • rust-script scripts/check-file-size.rs
  • cargo test --all-features --verbose
  • cargo test --doc --verbose
  • rust-script scripts/check-changelog-fragment.rs

Fixes #33

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #33
@konard konard self-assigned this May 12, 2026
@konard konard changed the title [WIP] Make a crater provider Add Crater ForgeFed OpenAI compatibility provider May 12, 2026
@konard konard marked this pull request as ready for review May 12, 2026 10:17
@konard

konard commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented and pushed the Crater ForgeFed provider in PR 34:

#34

Summary:

  • Added UPSTREAM_PROVIDER=crater with Crater inbox/actor/target/poll config.
  • Added OpenAI-compatible /v1/chat/completions handling for sync and SSE, including ?stream=true.
  • Translates chat requests into ForgeFed Offer + Ticket, parses Accept.result, polls task resolution, and maps back to OpenAI-style responses.
  • Added async TaskProvider abstraction, tests, docs, and changelog fragment.

Verification:

  • Local checks passed: fmt, clippy, file-size check, all tests, doc tests, changelog check.
  • PR CI passed on commit 8465363: lint/format, changelog, Ubuntu/macOS/Windows tests, and package build.
  • PR is ready for review and the working tree is clean.

This summary was automatically extracted from the AI working session output.

@konard

konard commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $21.516757

📊 Context and tokens usage:

  • 761.0K / 1.1M (72%) input tokens, 46.7K / 128K (36%) output tokens

Total: (761.0K + 11.8M cached) input tokens, 46.7K output tokens, $21.516757 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (75629KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 3354aab into main May 12, 2026
11 checks passed
@konard

konard commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

Make a crater provider

1 participant