Commit graph

67 commits

Author SHA1 Message Date
bot
da4bbebfed ci: add deploy workflow (build linux/amd64 to GHCR + SSH deploy to VPS) 2026-08-31 22:02:17 +00:00
bot
90b01f7414 chore: vercel rewrites point at workorder-api.lverma.com (VPS) 2026-08-31 21:11:09 +00:00
35069fe4ad
fix(backend): parse triage proposals wrapped in prose or code fences
Free-model routers often answer with surrounding prose, so a strict whole-
response JSON parse failed and every triage run ended in error. Extract the
first JSON block before parsing, keeping the zod schema gate intact.
2026-08-19 22:05:20 +05:30
f117d78baf
fix(frontend): keep the copilot overlay full-width so the drawer renders on desktop
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).
2026-08-19 22:05:20 +05:30
000586013b
test(frontend): assert the Copilot toggle opens the drawer 2026-08-19 21:46:21 +05:30
f136f52a51
feat(frontend): format agent run detail and jump to a run after manual triage
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>.
2026-08-19 21:46:21 +05:30
1ca37a6504
feat(backend): return the created run id from manual triage
runTriage now resolves to { outcome, runId } so the admin API can hand the
run id back to the UI for deep-linking into the run detail.
2026-08-19 21:46:21 +05:30
691980735a
fix(test): pin AI_MODEL in AI test env so suites are independent of the developer .env
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.
2026-08-19 21:46:21 +05:30
303def2205
fix(backend): treat missing aiEnabled as enabled for legacy users
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.
2026-08-19 21:46:21 +05:30
0de104568f
fix(frontend): stop redirect-to-login reload loop on the login page
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.
2026-08-19 21:27:38 +05:30
9d6258f21e
merge(feat/ai-cov-frontend): coverage gate green 2026-08-19 20:04:55 +05:30
097663c545
merge(feat/ai-cov-backend): coverage gate green 2026-08-19 20:04:55 +05:30
b8cb205e69
test(backend): raise AI surface coverage — provider client, admin agent API, policy, triage skip paths 2026-08-19 20:03:39 +05:30
8b568e6988
test(frontend): cover SSE stream client, copilot stream hook, and agent query hooks 2026-08-19 19:47:04 +05:30
b6a9b64c47
merge(feat/ai-ops): wave 3 2026-08-19 19:24:59 +05:30
0b9ce8ecd7
merge(feat/ai-frontend): wave 3 2026-08-19 19:24:59 +05:30
6c34342acc
merge(feat/ai-backend-tests): wave 3 2026-08-19 19:24:58 +05:30
14d978289f
feat(backend): wire PATCH /admin/users/:id/ai endpoint for the AI opt-out toggle 2026-08-19 19:24:55 +05:30
7a84996f51
test(backend): agent runtime, copilot API, and triage/worker suites with mocked provider
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
2026-08-19 19:23:00 +05:30
2975e20b63
feat(frontend): copilot panel with SSE + approvals, admin agent pages, AI toggle 2026-08-19 19:15:23 +05:30
32aa7f6ade
chore(ops): worker compose services, AI env template, docs, ADR, and agentic-AI spec 2026-08-19 19:10:07 +05:30
93e828bcb1
merge(feat/ai-triage): wave 2
# Conflicts:
#	backend/src/routes/index.ts
2026-08-19 18:53:21 +05:30
dcf241d8e6
merge(feat/ai-copilot): wave 2 2026-08-19 18:52:52 +05:30
1fa20411aa
fix(backend): defer provider endpoint/header resolution to call time
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.
2026-08-19 18:52:47 +05:30
84140f31b1
feat(backend): copilot agent runtime, tool registry, and /api/v1/ai API with SSE 2026-08-19 18:50:46 +05:30
7d224f162d
feat(backend): autonomous triage agent, polling worker, and admin agent API 2026-08-19 18:41:37 +05:30
757125e727
fix(backend): use typed AI env and pass assistant tool_calls through provider messages 2026-08-19 18:34:11 +05:30
014e77a5cd
merge(feat/ai-backend-provider): wave 1 2026-08-19 18:24:32 +05:30
84baf39a10
merge(feat/ai-backend-core): wave 1 2026-08-19 18:24:32 +05:30
105d8d78c4
merge(feat/ai-backend-env): wave 1 2026-08-19 18:24:32 +05:30
84c29cd8f2
feat(backend): OpenAI-compatible LLM provider adapter with streaming and SSRF hardening 2026-08-19 18:24:06 +05:30
c97c5f37e3
feat(backend): agentic AI data layer — actor capability, agent models/repos, outbox, triagePatch, aiEnabled 2026-08-19 18:11:58 +05:30
e88568139c
feat(backend): AI/agent environment config with SSRF-safe provider URL validation 2026-08-19 17:56:42 +05:30
3f3fdf8a85
feat(shared): agentic AI types, error codes, tool and SSE schemas
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).
2026-08-19 17:45:17 +05:30
Lakshit Verma
96f960e0c9
Update README.md 2026-08-17 07:23:24 +05:30
5fd89ee85e
feat(ui): add favicon 2026-08-17 02:20:58 +05:30
835ed20278
fix(test): run backend test files sequentially against a shared database 2026-08-17 02:17:10 +05:30
3cef79b9d4
ci: run on the master branch 2026-08-17 02:13:53 +05:30
50d238e2f5
docs(readme): add code coverage badge 2026-08-17 02:13:11 +05:30
7b3d78f43f
ci(codecov): upload coverage reports 2026-08-17 02:13:11 +05:30
545a8306fb
chore(test): emit lcov coverage reports 2026-08-17 02:13:10 +05:30
0bbbc2aab5
docs(readme): add production and security notes 2026-08-17 02:06:49 +05:30
6d4934d1b2
chore(build): build shared before typecheck, test, and dev 2026-08-17 02:06:49 +05:30
444da042b3
chore(infra): reproducible installs and correct deployment config 2026-08-17 02:06:49 +05:30
bee8838360
fix(client): single-flight the redirect and preserve the intended route 2026-08-17 02:06:49 +05:30
0a4574551a
fix(a11y): improve contrast and add page titles and labels 2026-08-17 02:06:48 +05:30
bf76061847
fix(a11y): announce form errors and wire aria attributes 2026-08-17 02:06:48 +05:30
5bada2ee6f
fix(a11y): make the confirm dialog keyboard accessible 2026-08-17 02:06:48 +05:30
fdd0bfed6b
feat(ui): add mobile navigation 2026-08-17 02:06:48 +05:30
e1aff1fb2f
fix(ux): preserve edits when a version conflict occurs 2026-08-17 02:06:48 +05:30