Some checks failed
CI / backend-test (push) Successful in 4m9s
CI / frontend-test (push) Failing after 3m48s
CI / lint-python (push) Successful in 1m41s
CI / secret-scanning (push) Successful in 1m20s
CI / dependency-scan (push) Successful in 10m50s
CI / workflow-summary (push) Successful in 1m11s
## Features Added
### Document Reference System
- Implemented numbered document references (@1, @2, etc.) with autocomplete dropdown
- Added fuzzy filename matching for @filename references
- Document filtering now prioritizes numeric refs > filename refs > all documents
- Autocomplete dropdown appears when typing @ with keyboard navigation (Up/Down, Enter/Tab, Escape)
- Document numbers displayed in UI for easy reference
### Conversation Management
- Added conversation rename functionality with inline editing
- Implemented conversation search (by title and content)
- Search box always visible, even when no conversations exist
- Export reports now replace @N references with actual filenames
### UI/UX Improvements
- Removed debug toggle button
- Improved text contrast in dark mode (better visibility)
- Made input textarea expand to full available width
- Fixed file text color for better readability
- Enhanced document display with numbered badges
### Configuration & Timeouts
- Made HTTP client timeouts configurable (connect, write, pool)
- Added .env.example with all configuration options
- Updated timeout documentation
### Developer Experience
- Added `make test-setup` target for automated test conversation creation
- Test setup script supports TEST_MESSAGE and TEST_DOCS env vars
- Improved Makefile with dev and test-setup targets
### Documentation
- Updated ARCHITECTURE.md with all new features
- Created comprehensive deployment documentation
- Added GPU VM setup guides
- Removed unnecessary markdown files (CLAUDE.md, CONTRIBUTING.md, header.jpg)
- Organized documentation in docs/ directory
### GPU VM / Ollama (Stability + GPU Offload)
- Updated GPU VM docs to reflect the working systemd environment for remote Ollama
- Standardized remote Ollama port to 11434 (and added /v1/models verification)
- Documented required env for GPU offload on this VM:
- `OLLAMA_MODELS=/mnt/data/ollama`, `HOME=/mnt/data/ollama/home`
- `OLLAMA_LLM_LIBRARY=cuda_v12` (not `cuda`)
- `LD_LIBRARY_PATH=/usr/local/lib/ollama:/usr/local/lib/ollama/cuda_v12`
## Technical Changes
### Backend
- Enhanced `docs_context.py` with reference parsing (numeric and filename)
- Added `update_conversation_title` to storage.py
- New endpoints: PATCH /api/conversations/{id}/title, GET /api/conversations/search
- Improved report generation with filename substitution
### Frontend
- Removed debugMode state and related code
- Added autocomplete dropdown component
- Implemented search functionality in Sidebar
- Enhanced ChatInterface with autocomplete and improved textarea sizing
- Updated CSS for better contrast and responsive design
## Files Changed
- Backend: config.py, council.py, docs_context.py, main.py, storage.py
- Frontend: App.jsx, ChatInterface.jsx, Sidebar.jsx, and related CSS files
- Documentation: README.md, ARCHITECTURE.md, new docs/ directory
- Configuration: .env.example, Makefile
- Scripts: scripts/test_setup.py
## Breaking Changes
None - all changes are backward compatible
## Testing
- All existing tests pass
- New test-setup script validates conversation creation workflow
- Manual testing of autocomplete, search, and rename features
102 lines
3.1 KiB
JavaScript
102 lines
3.1 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { api } from '../src/api.js';
|
|
|
|
|
|
test('api.listDocuments calls correct endpoint', async () => {
|
|
const calls = [];
|
|
globalThis.fetch = async (url, options) => {
|
|
calls.push({ url: String(url), options });
|
|
return {
|
|
ok: true,
|
|
json: async () => [{ id: '1', filename: 'a.md', bytes: 3 }],
|
|
};
|
|
};
|
|
|
|
const out = await api.listDocuments('conv123');
|
|
assert.equal(calls.length, 1);
|
|
assert.match(calls[0].url, /\/api\/conversations\/conv123\/documents$/);
|
|
assert.deepEqual(out, [{ id: '1', filename: 'a.md', bytes: 3 }]);
|
|
});
|
|
|
|
|
|
test('api.uploadDocument uses multipart form and POST', async () => {
|
|
const calls = [];
|
|
globalThis.fetch = async (url, options) => {
|
|
calls.push({ url: String(url), options });
|
|
return {
|
|
ok: true,
|
|
json: async () => ({ id: 'doc1', filename: 'x.md', bytes: 10 }),
|
|
};
|
|
};
|
|
|
|
// Node 18 doesn't provide a global File, but it does provide Blob.
|
|
// Our api.uploadDocument supports Blob + filename.
|
|
const file = new Blob(['hello'], { type: 'text/markdown' });
|
|
file.name = 'x.md';
|
|
const out = await api.uploadDocument('conv999', file);
|
|
|
|
assert.equal(calls.length, 1);
|
|
assert.match(calls[0].url, /\/api\/conversations\/conv999\/documents$/);
|
|
assert.equal(calls[0].options.method, 'POST');
|
|
assert.ok(calls[0].options.body instanceof FormData);
|
|
assert.equal(out.id, 'doc1');
|
|
});
|
|
|
|
test('api.uploadDocuments uses multipart form and POST', async () => {
|
|
const calls = [];
|
|
globalThis.fetch = async (url, options) => {
|
|
calls.push({ url: String(url), options });
|
|
return {
|
|
ok: true,
|
|
json: async () => ({ uploaded: [{ id: 'a' }, { id: 'b' }] }),
|
|
};
|
|
};
|
|
|
|
const a = new Blob(['one'], { type: 'text/markdown' });
|
|
a.name = 'a.md';
|
|
const b = new Blob(['two'], { type: 'text/markdown' });
|
|
b.name = 'b.md';
|
|
|
|
const out = await api.uploadDocuments('conv999', [a, b]);
|
|
|
|
assert.equal(calls.length, 1);
|
|
assert.match(calls[0].url, /\/api\/conversations\/conv999\/documents$/);
|
|
assert.equal(calls[0].options.method, 'POST');
|
|
assert.ok(calls[0].options.body instanceof FormData);
|
|
assert.equal(out.uploaded.length, 2);
|
|
});
|
|
|
|
test('api.getDocument calls correct endpoint', async () => {
|
|
const calls = [];
|
|
globalThis.fetch = async (url) => {
|
|
calls.push({ url: String(url) });
|
|
return {
|
|
ok: true,
|
|
json: async () => ({ id: 'd1', content: '# hi' }),
|
|
};
|
|
};
|
|
|
|
const out = await api.getDocument('c1', 'd1');
|
|
assert.equal(calls.length, 1);
|
|
assert.match(calls[0].url, /\/api\/conversations\/c1\/documents\/d1$/);
|
|
assert.equal(out.content, '# hi');
|
|
});
|
|
|
|
test('api.deleteDocument uses DELETE', async () => {
|
|
const calls = [];
|
|
globalThis.fetch = async (url, options) => {
|
|
calls.push({ url: String(url), options });
|
|
return { ok: true, json: async () => ({ ok: true }) };
|
|
};
|
|
|
|
const out = await api.deleteDocument('c1', 'd1');
|
|
assert.equal(calls.length, 1);
|
|
assert.match(calls[0].url, /\/api\/conversations\/c1\/documents\/d1$/);
|
|
assert.equal(calls[0].options.method, 'DELETE');
|
|
assert.equal(out.ok, true);
|
|
});
|
|
|
|
|