Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 0 additions & 239 deletions .agents/skills/llmock/SKILL.md

This file was deleted.

42 changes: 0 additions & 42 deletions .agents/skills/llmock/references/config.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ jobs:
working-directory: e2e_tests/${{ matrix.name }}
run: just install

- name: Install Playwright browsers
working-directory: e2e_tests/${{ matrix.name }}
run: just install-playwright

- name: Run Playwright tests
working-directory: e2e_tests/${{ matrix.name }}
run: just test
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ modAI-chat/
├── backend/
│ ├── omni/ # Python FastAPI backend
│ └── tools/dice-roller/ # Example tool microservice
├── docs/ # User, admin & developer documentation
├── frontend/
│ └── omni/ # Svelte TypeScript SPA
└── e2e_tests/
Expand All @@ -43,9 +44,18 @@ Why more than one frontend: because there are different use cases. e.g. one full
### Prerequisites
- Python 3.13+
- Node.js 24+
- UV package manager
- Docker (for NanoIDP identity provider)
- Optional: [just](https://github.com/casey/just)
- [pnpm](http://pnpm.io)
- [uv](https://docs.astral.sh/uv)
- Docker
- [just](https://github.com/casey/just)

For easy dependency installation of the whole repo, run

```bash
just install
```

this installes the python/npm dependencies for all subprojects.

### NanoIDP Setup (Identity Provider)
Start the lightweight local OIDC identity provider (runs on port 9000):
Expand All @@ -59,16 +69,16 @@ nanoidp Dashboard: http://localhost:9000
```bash
cd backend/omni
cp .env.sample .env
uv sync
uv run uvicorn modai.main:app --reload
just install
just start
```

### Frontend Setup
```bash
cd frontend/omni
ln -sf modules_with_backend.json public/modules.json
pnpm install
pnpm dev
just install
just start
```

Browse to http://localhost:5173/
Expand Down
13 changes: 0 additions & 13 deletions backend/omni/docs/learnings/INSTRUCTION_UPDATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,7 @@ This file tracks corrections provided by the user to improve future performance.
- **Correction**: Tests should only verify observable behavior (e.g. construction succeeds/fails, method returns expected result), never assert on internal instance attributes.
- **New Rule**: Never assert on internal object fields/state in tests. Only verify behavior: does it raise? Does the return value match expectations? Does it produce the correct side-effects?

### 2026-03-04 - No `patch` in tests — use testcontainers + pytest-httpserver
- **Mistake**: Used `unittest.mock.patch` to spy on `_create_agent` and mock `httpx.Client` to test tool handler behaviour.
- **Correction**: `patch` must not be used. The file under test should be modular enough that all external dependencies can be configured. For the LLM side use an llmock testcontainer; for tool HTTP endpoints use `pytest-httpserver`.
- **New Rule**: Never use `patch`. For tool invocation tests, configure llmock with `ToolCallStrategy` and point `ToolDefinition.url` at a `pytest-httpserver` instance.

### 2026-03-04 - Explicit user directive: no whitebox testing anywhere
- **Mistake**: Writing tests that target individual private/internal functions to achieve coverage.
- **Correction**: All tests must exercise only the public interface. If internal logic needs coverage, improve public-API tests, not private-function tests.
- **New Rule**: NO WHITEBOX TESTING. Never test `_prefixed` functions or assert on private object state. A test that does so is incorrect by definition and must be rewritten to go through the public API. Updated `AGENTS.md`.

### 2026-03-13 - Injected metadata in tool params uses `_` prefix
- **Convention**: When the caller needs to pass transport-level metadata (e.g. bearer token) into `Tool.run`, inject it as a `_`-prefixed key in the `params` dict (e.g. `_bearer_token`). The implementation pops those keys before building the request body; they are never forwarded as JSON payload.
- **New Rule**: Any caller-injected, non-payload property passed via `params` MUST use a `_`-prefixed key. Document new keys in `docs/architecture/tools.md` under "Reserved `_`-prefixed keys".

- **Mistake**: Passed `base_url = f"{root_url}/v1"` — the updated llmock no longer mounts routes under `/v1`.
- **Correction**: All llmock endpoints are now at the root (`/chat/completions`, `/models`, `/health`). Pass `base_url = f"{root_url}/"` (trailing slash) so the OpenAI SDK does not append `/v1`.
- **New Rule**: Always use `base_url = "http://<host>:<port>/"` (trailing slash) when connecting to llmock. The SKILL.md has been updated.
2 changes: 1 addition & 1 deletion backend/omni/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dev = [
"pytest-asyncio",
"pytest-httpserver",
"ruff",
"testcontainers",
"testcontainers>=4.15.0rc2",
]

[tool.pytest.ini_options]
Expand Down
Loading
Loading