Skip to content

Claude/read spec n6efu#169

Merged
yellowman merged 5 commits intomainfrom
claude/read-spec-n6efu
Dec 26, 2025
Merged

Claude/read spec n6efu#169
yellowman merged 5 commits intomainfrom
claude/read-spec-n6efu

Conversation

@yellowman
Copy link
Copy Markdown
Owner

@yellowman yellowman commented Dec 26, 2025

Note

Tightens security and aligns QA/tests with current API and infra expectations.

  • Security: Add middleware to block direct access to /_static/admin.html; require /admin route with auth in liminallm/app.py.
  • QA/Testing: Update scripts/smoke_test.sh to use correct chat schema (message + mode, stream) and file upload endpoint POST /v1/files/upload; improve portability of counters and keep suite running on failures; enhance output with response bodies.
  • Tests: Adjust tests/test_post_smoke.py for new upload response (fs_path) and chat schema in cross-user checks.
  • Docker/Makefile: Start redis alongside postgres for PG tests; set USE_MEMORY_STORE=false, updated DATABASE_URL/REDIS_URL; add bootstrap dependency in docker-compose.test.yml.
  • Docs: Rename adapter env vars to OPENAI_ADAPTER_* and correct examples/instructions in DEPLOYMENT.md and QA_RUNBOOK.md (Redis, pgvector note, correct endpoints).

Written by Cursor Bugbot for commit 39d57e7. This will update automatically on new commits. Configure here.

- Fix chat payload: use {conversation_id, message: {content, mode}, stream}
  instead of {conversation_id, content}
- Fix file upload endpoint: use /v1/files/upload (not /v1/files)
- Combine double curl calls into single call capturing body + status
- Remove 422 as acceptable success code (indicates test bug, not API issue)
- Fix bash arithmetic to avoid early exit with set -e
- Add || true to test calls so failures don't abort the suite
test_post_smoke.py:
- Fix chat payload to use correct schema: {conversation_id, message: {content, mode}, stream}
- Fix file upload assertion: check for fs_path (not file_id/id)

docker-compose.test.yml:
- Add bootstrap dependency to app service to ensure migrations run before app starts
Makefile test-pg:
- Fix DATABASE_URL: liminallm:testpassword123 (was testuser:testpass)
- Add USE_MEMORY_STORE=false to actually use PostgreSQL
- Add REDIS_URL for redis-backed rate limits
- Start redis container alongside postgres

QA_RUNBOOK.md:
- Fix Docker PostgreSQL test credentials to match compose
- Add USE_MEMORY_STORE=false to both Docker and native PostgreSQL tests
- Add REDIS_URL to Docker test section
Changed:
- ADAPTER_OPENAI_API_KEY → OPENAI_ADAPTER_API_KEY
- ADAPTER_OPENAI_BASE_URL → OPENAI_ADAPTER_BASE_URL

These must match the env var names in config.py and .env.example.
runtime.py:
- Remove unused `timedelta(seconds=window_seconds)` line in check_rate_limit()

app.py:
- Block direct access to /static/admin.html (returns 403)
- Admin UI is only accessible via /admin route which enforces auth
@yellowman yellowman merged commit 26b48e4 into main Dec 26, 2025
1 of 2 checks passed
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