The overlay used 'fixed inset-0 lg:left-auto', which lets the container
shrink-to-fit on desktop and collapse the drawer to a sliver (or nothing),
so the open state changed but nothing was visible. Drop left:auto and hide
the overlay fully when closed (visibility + pointer-events).
Hide the static system prompt behind a note, pretty-print JSON message
content, label tool args/result, use an inline spinner for detail loading,
and deep-link to the fresh run from the Agent Settings 'Run triage now'
button via ?run=<id>.
The provider tests asserted the default gpt-4o-mini model, which broke once
a local .env set AI_MODEL=openrouter/free. The test env now pins the model
before config/env is imported.
Users seeded before the aiEnabled field existed read as undefined via lean(),
and the copilot runtime treated undefined as disabled, 403-ing session
creation. Only an explicit false now disables; toUserAdmin also defaults
the field to true for display.
GuestRoute calls useMe() on /login; a logged-out user gets 401 from
/users/me, the client tries refresh, fails, then window.location.assign
('/login') reloads the page while already on /login, restarting the cycle
indefinitely. Skip the redirect when already on the login page and let the
guest route render the form. Adds a regression test.
Also fix two bugs the tests surfaced in the merged AI implementation:
- agent-tool-call model made approval.summary/expiresAt conditionally required only when an approval subdocument is present, so blocked/error tool calls persist without a fake approval
- agent.repo.createRun coerced empty-string session/user ids to null so autonomous triage runs (no session/user) no longer fail ObjectId casting
The provider previously evaluated env.AI_BASE_URL at module load, which
threw when AI is disabled (no URL configured). Compute the endpoint and
Authorization header lazily inside the fetch calls so importing the module
never fails; the runtime and triage layers already gate on AI_ENABLED first.
Extend the closed error catalog with the AI error codes (AI_UNAVAILABLE,
AI_BUDGET_EXCEEDED, approval lifecycle codes, AI_INJECTION_BLOCKED), add the
AgentRun/AgentToolCall/AgentConfig/CopilotSession/TriageSuggestion DTOs,
add aiEnabled to UserAdmin, and add the LLM-facing tool arg schemas plus the
zod-validated SSE event schema. Owner/version stay out of tool args per the
agentic spec (the runtime injects them).