feat: add rag demo and smoke test#35
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { NextResponse } from "next/server"; | ||
|
|
||
| const CONTROL_BASE = process.env.CONTROL_BASE_URL || "http://control:8000"; | ||
| const CONTROL_BASE = | ||
| process.env.NEXT_PUBLIC_CONTROL_BASE || | ||
| process.env.CONTROL_BASE_URL || | ||
| "http://localhost:8000"; |
There was a problem hiding this comment.
Restore docker-friendly default control URL
The onboarding API handlers now resolve CONTROL_BASE from NEXT_PUBLIC_CONTROL_BASE and default to http://localhost:8000. In the docker‑compose setup the console container is still populated with NEXT_PUBLIC_CONTROL_URL and no CONTROL_BASE_URL, so these routes fall back to localhost and the HTTP requests target the console container itself rather than the control service (ECONNREFUSED). Either keep http://control:8000 as the default or read the existing NEXT_PUBLIC_CONTROL_URL env var to avoid breaking compose deployments. (The same pattern appears in the status and submit routes.)
Useful? React with 👍 / 👎.
| def __init__(self) -> None: | ||
| with open(CONFIG_PATH, "r", encoding="utf-8") as stream: | ||
| self.cfg = yaml.safe_load(stream) or {} | ||
| models_cfg = self.cfg.get("models", {}) |
There was a problem hiding this comment.
Guard AIRouter config file access
The new AIRouter constructor immediately does with open(CONFIG_PATH, ...) and propagates FileNotFoundError. The control image does not include /app/config/aionos.config.yaml by default and docker‑compose doesn’t mount one, so any call to /ai/chat raises 500 on first run. This should mirror the onboarding routes by tolerating a missing config (e.g. defaulting to {} or lazily creating the file) so the chat demo works out of the box.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6901088bfc7483288bc7e2472bb62e44