chore: CI, branch protection, issue/PR templates, README demo GIF#1
chore: CI, branch protection, issue/PR templates, README demo GIF#1
Conversation
…nc/error handling
…mo GIF - GitHub Actions CI: tsc + vitest on every PR targeting main - PR template enforcing issue reference (Closes #N) - Issue templates for bug reports and feature requests - README: replace 3 separate GIFs with single demo.gif (full flow) - Fix: agentStore missing projects/appView/activeProjectKey state - Fix: App.tsx prefetch /api/tree on mount so HomeScreen loads projects
There was a problem hiding this comment.
Code Review
This pull request significantly expands the Agentree project by introducing a project-based home screen, a session sidebar, and comprehensive documentation in the README. It also adds GitHub issue and pull request templates. On the technical side, the PR improves client-side type safety for session and message handling, integrates task invocation tracking into the Zustand store, and establishes a centralized Hono server structure with robust error handling. Feedback was provided to ensure the server's error handler correctly captures and returns details for non-Error objects.
| app.onError((err, c) => { | ||
| console.error(`[error] ${c.req.method} ${c.req.path}:`, err instanceof Error ? err.message : String(err)) | ||
| const status = err instanceof Error && 'status' in err ? (err as { status: number }).status : 500 | ||
| return c.json({ error: err.message ?? 'Internal Server Error' }, status as 500) |
There was a problem hiding this comment.
The error response body currently relies solely on err.message. If the thrown error is not an instance of Error (e.g., a string or a custom object without a message property), the client will receive a generic 'Internal Server Error' even if specific error information is available. Using the same logic as the console log ensures that the actual error content is returned to the client. Additionally, using status as any is preferred over the misleading as 500 type assertion when dealing with dynamic status codes in Hono.
| return c.json({ error: err.message ?? 'Internal Server Error' }, status as 500) | |
| return c.json({ error: err instanceof Error ? err.message : String(err) }, status as any) |
- CI: add separate 'Type check (client)' step for tsconfig.client.json;
previously tsc --noEmit only checked src/server, leaving all client
errors invisible
- agentStore: export TaskInvocation and ActiveProjectKey; add hasParent,
detached, taskCount, pendingTaskCount, incomingTask to AgentNodeData;
populate them in buildGraph (detach/reattach button was always hidden
because hasParent/detached were never set); add detached to
SessionInfo.canvas so session.canvas?.detached is not always undefined
- SessionPanel: remove { type: string } catch-all from MessagePart union;
it was a supertype of all variants, blocking TypeScript narrowing in
every if (part.type === '...') branch; replace with explicit step-start
and snapshot variants
- App: add try/catch to refreshTree so initial-load errors are logged
Commit the complete working state that was on disk but never staged: - HomeScreen, ProjectTabBar, SessionListSidebar (new client components) - src/server/routes/project.ts (was imported by app.ts but missing from git) - drizzle migrations 0003–0005 (task_invocation, detach, projects) - broadcaster.test.ts, real-opencode integration test, vitest.opencode.config - Updated AgentCanvas, AgentEdge, AgentNode, SubtaskDialog, agentStore - Updated server db schema/index, session/canvas/tree/system routes, compat adapter, types, index
What
tsc+vitest) on every PR targeting mainCloses #Nconventiondemo.gifshowing full app flowagentStoremissingprojects/appView/activeProjectKeystateApp.tsxprefetch/api/treeon mount so HomeScreen loads projects immediatelyWhy
Now that the repo is public, direct pushes to
mainare blocked. All changes go through PR + CI + review.Note: This PR sets up the CI workflow itself — subsequent PRs will have the
cicheck enforced automatically.Test plan
pnpm exec tsc --noEmitpassespnpm test— 72 tests pass