mirror of
https://github.com/coleam00/Archon
synced 2026-04-21 13:37:41 +00:00
* Archon UI PRD and phase 1 plan
* Initial Archon UI
* Workflow tracking
* UI improvements (with a couple schema changes)
* Message history for web adapter and UI adjustments
* Chat/Project/Tasks in Archon UI
* UI fixes
* UI fixes
* UI improvements
* Fix PR review issues: type safety, error handling, cleanup, docs
- Convert MessageChunk to discriminated union with workflow_dispatch variant
- Add IWebPlatformAdapter interface and isWebAdapter() type guard
- Replace unsafe 'in' type guards with proper type narrowing in orchestrator
- Add logging to silent catch blocks in api.ts, web.ts
- Add WebAdapter buffer cleanup with 60s delayed cleanup on disconnect
- Wrap SQLite migration ALTER TABLE groups in try/catch
- Log SSE parse errors in useSSE.ts
- Truncate API error bodies to 200 chars, include URL path
- Surface background workflow errors to parent conversation
- Fix getWorkflowRunByWorker to only swallow 404s, re-throw 500s
- Add documentation comments to ChatMessage and SSEEvent types
- Update table counts from 3/5/6 to 8 across all docs
* Remove agent plan files from PR, gitignore .agents/plans/
These are local development artifacts that shouldn't be in the repo.
* Gitignore .claude/PRPs/
* Fix PR review issues: error handling, type safety, silent failures
- Fix acquireLock error swallowing: wrap handler in try/catch/finally to
always release UI lock and surface errors to SSE stream
- Restrict CORS to configurable origin (WEB_UI_ORIGIN env var)
- Validate status query param instead of unsafe `as` cast
- Add per-codebase JSON.parse error isolation for corrupted commands
- Type request body in POST /api/conversations
- Return 404 for missing conversation instead of empty array
- Add warning log when flushAssistantMessage has no DB ID mapping
- Add debug logging to 6 SSE catch blocks (was silently swallowing)
- Replace 17x .catch(() => undefined) with void on fire-and-forget calls
- Make workflow status='running' update a blocking error
- Split MessageChunk into proper per-type discriminated union
- Add hidden field to Conversation interface
- Add guard in addMessage for undefined row
- Extract WorkflowRunStatus/WorkflowStepStatus type aliases
- Fix WorkflowArtifact.type to use literal union
- Separate SSE parse errors from handler errors in useSSE hook
- Gitignore e2e testing session artifact
* Wire up dead endpoints: workflow run UI, health display, worker→run link
- Extract dispatchToOrchestrator() helper to deduplicate lock/dispatch
logic between message send and workflow run endpoints
- Fix workflow run endpoint to construct /workflow run <name> <msg>
from URL param + body, with name validation
- Add run panel to WorkflowList with message input, error display,
and navigation to chat on success
- Add System Health section to SettingsPage with independent query
and actionable error messages
- Add worker→run navigation link in WorkflowExecution header
- Regenerate 000_combined.sql to include migrations 001-015
- Fix silent .catch() patterns: log errors instead of swallowing
- Wrap emitSSE in catch block, log full error objects
* Fix routing for conversation IDs with special characters
GitHub issue conversation IDs like "user/repo#42" contain / and #
which break React Router's :param matching. Fix by:
- Use /chat/* splat route instead of /chat/:conversationId
- encodeURIComponent() all platform_conversation_id values in URLs
- decodeURIComponent() in ChatPage when reading the splat param
* Restructure sidebar: project selector nav, remove dead components
Replace multi-view sidebar (ChatView, ProjectView, TaskView, ViewSwitcher)
with a simpler project-scoped navigation. Add ProjectSelector component
for switching between codebases. Remove unused ConversationsList,
useNotifications hook, and related dead code.
* Add project CRUD: clone/register from UI, delete with cleanup
Extract clone logic from command-handler into standalone clone.ts module
with cloneRepository() and registerRepository() entry points. Add REST
endpoints POST /api/codebases (clone URL or register local path) and
DELETE /api/codebases/:id (destroy worktrees, unlink DB, remove workspace).
Update sidebar with "+" button for inline project add input that auto-detects
URL vs local path, and hover-to-delete with AlertDialog confirmation on each
project in ProjectSelector.
* Harden backend guard rails, polish UX, remove dead project pages
Backend:
- Guard output callback and cleanup timer with try-catch
- Add zombie stream reaper (5min interval) with proper cleanup
- Force-flush assistant buffer at 50 segments to prevent unbounded growth
- Log warning on message buffer overflow
- Emit SSE warning when user message persistence fails
Frontend:
- Show spinner on send button while processing
- Add native tooltip on truncated conversation titles
- Make sidebar resize handle visible with subtle background
Dead code:
- Delete orphaned ProjectDetail, ProjectsList, ProjectsPage
- Remove /projects/:id route from App.tsx
* Dashboard landing page, chat empty state, API error quality, SQLite indexes
- Replace DashboardPage redirect with landing page showing recent
conversations and workflow runs in a two-column grid
- Fix /chat empty state to render ChatInterface in new-chat mode
instead of a static placeholder
- Add proper HTTP status codes to API: 404 for missing conversations,
400 for invalid codebase IDs, empty array for failed workflow discovery
- Add 3 missing indexes to SQLite schema from PG migrations 009/010
(workflow run staleness, session parent, session conversation lookup)
* Scope workflow runs to selected project
Pass the selected project's codebaseId when creating a conversation
for workflow execution. Show which project the workflow will target,
and disable the run controls when no project is selected.
* Inline project selector in workflow invocation panel
Replace static "Running on {project}" text with a <select> dropdown
so users can pick a project without leaving the workflow view.
* Fix chat header showing "No project" and new chat missing project
Header now resolves project name from codebase_id when cwd is absent.
Dashboard "New Chat" creates conversation with selected project instead
of navigating to an orphaned /chat route. Buttons disabled when no
project is selected.
* Sidebar nav, workflow builder route, workflow invoker in project detail
Add Workflows and Workflow Builder nav links to sidebar, extract
navLinkClass helper. Wire WorkflowInvoker into ProjectDetail. Add
WorkflowBuilderPage route. Remove dead redirect routes and unused
Header from pages that don't need it.
* Fix review issues: guard rm-rf, error handling, Error Boundary, dedup utility
- Guard DELETE /api/codebases/:id to only rm-rf paths under ~/.archon/workspaces/
(externally registered repos only get DB record deleted)
- Remove accidental e2e-testing-findings-session2.md
- Replace 3x .catch(() => undefined) with proper error logging
- Add React Error Boundary at app root to prevent white-screen crashes
- Wrap JSON.parse(metadata) in try-catch in ChatInterface and WorkflowLogs
- Upgrade SSE write failure logging from debug to warn, add missing logging
- Fix bare catch in SSE heartbeat to only swallow disconnect errors
- Remove unused _createErrorHandler parameter from registerApiRoutes
- Extract shared findMarkdownFilesRecursive to packages/core/src/utils/commands.ts
- Convert boolean to integer explicitly for SQLite hidden column
- Surface workflow discovery errors as warning in API response
* Address PR review: error handling, SSE resilience, test coverage
- Fix path traversal in codebase deletion (use normalizedCwd)
- Buffer SSE write failures for reconnect delivery (3 catch blocks)
- Extract flushBufferedMessages helper with partial-failure recovery
- Add defensive outer catch to background workflow dispatch
- Surface API/load errors to users (history, metadata, React Query)
- Add SSE parse validation and handler error surfacing
- Show stale indicator when workflow polling loses connection
- Add delete error handling to ConversationItem dialog
- Import shared types from @archon/core instead of duplicating
- Lower activity update failure threshold from 5 to 3
- Add test coverage for messages.ts and workflow-events.ts (100%)
* docs: Update documentation for Web UI, workflow events, and message persistence
- Update database schema description (workflow_events detail, messages metadata)
- Add Web UI platform adapter to architecture docs
- Document REST API endpoints for Web UI
- Add SSE streaming pattern documentation
- Update conversation schema (title, deleted_at columns)
- Expand Web UI feature list (workflow invocation, message persistence)
* Address PR review: error handling, type safety, SSE resilience
- Add null check on createWorkflowRun INSERT return
- Narrow catch in registerRepoAtPath to not swallow command loading errors
- Add SSE onerror logging and user notification on permanent close
- Add WarningEvent to SSE union and surface warnings in ChatInterface
- Fix WorkflowEventRow.data SQLite type mismatch (parse JSON string)
- Separate conversation lookup from auto-titling error handling
- Fix log levels for data loss scenarios (warn/debug → error)
- Emit SSE warning to user on flushAssistantMessage failure
- Set workflow run parent link regardless of success/failure
- Cap total buffered conversations at 200
- Define ArtifactType once in core, use everywhere
- Use imported status types in SSE event interfaces
- Add exhaustiveness checks in switch statements
- Preserve original git error in registerRepository
- Remove unused recoverable field from ErrorEvent
---------
Co-authored-by: Rasmus Widing <rasmus.widing@gmail.com>
21 lines
951 B
SQL
21 lines
951 B
SQL
-- Workflow events - lean UI-relevant events for observability
|
|
-- Stores step transitions, parallel agent status, artifacts, errors.
|
|
-- Verbose assistant/tool content stays in JSONL logs at {cwd}/.archon/logs/{runId}.jsonl
|
|
|
|
CREATE TABLE IF NOT EXISTS remote_agent_workflow_events (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
workflow_run_id UUID NOT NULL REFERENCES remote_agent_workflow_runs(id) ON DELETE CASCADE,
|
|
event_type VARCHAR(50) NOT NULL,
|
|
step_index INTEGER,
|
|
step_name VARCHAR(255),
|
|
data JSONB DEFAULT '{}',
|
|
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_workflow_events_run_id
|
|
ON remote_agent_workflow_events(workflow_run_id);
|
|
CREATE INDEX IF NOT EXISTS idx_workflow_events_type
|
|
ON remote_agent_workflow_events(event_type);
|
|
|
|
COMMENT ON TABLE remote_agent_workflow_events IS
|
|
'Lean UI-relevant workflow events for observability (step transitions, artifacts, errors)';
|