Skip to content

feat(tasks): split list/detail endpoints + add updated_at recency sort#183

Merged
tildesrc merged 2 commits into
mainfrom
panopticon/split-list-detail-endpoints
Jun 25, 2026
Merged

feat(tasks): split list/detail endpoints + add updated_at recency sort#183
tildesrc merged 2 commits into
mainfrom
panopticon/split-list-detail-endpoints

Conversation

@tildesrc

@tildesrc tildesrc commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GET /taskslist[TaskSummaryOut]: cheap list endpoint returning only tasks-table fields (no history), with an optional ?terminal=bool filter
  • GET /tasks/{id}TaskOut: full detail endpoint with history (was previously the only endpoint)
  • updated_at: ISO-8601 timestamp stamped by the task service on every mutation (field change, history append/update); exposed on both response types; the dashboard's sort uses it for recency (most recently updated first within each tier)
  • Alembic migration ed8efc0b01ac adds the updated_at column to the task table

Details

GET /tasks uses SQLAlchemy noload() to skip the history and responsibility joins entirely — two fewer SELECTs per task. The dashboard detail pane fetches the full task via GET /tasks/{id} on demand (cached per refresh cycle in _task_detail_cache).

The _sort_key in the dashboard now has four tiers: non-terminal first, user-turn first, most-recently-updated first (negative timestamp), then slug/id for stability.

🤖 Generated with Claude Code

Panopticon Agent and others added 2 commits June 25, 2026 22:38
GET /tasks now returns TaskSummaryOut (no history), skipping the two
extra SELECT queries that history + responsibilities required. An optional
?terminal=bool query param filters to active or terminal tasks only.

GET /tasks/{id} is unchanged — full TaskOut with history.

The dashboard's _sort_key drops history-based recency (slug/id is the
tiebreaker now) and the detail pane fetches the full task on demand via
GET /tasks/{id}, caching the result until the next refresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Stamps every task mutation (any field change or history append/update)
with an ISO-8601 updated_at via a _save_task() helper in the service.
Both GET /tasks (TaskSummaryOut) and GET /tasks/{id} (TaskOut) expose
the field. The dashboard's _sort_key gains a third tier that sorts most
recently updated tasks first within each (terminal, turn) group.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tildesrc tildesrc changed the title feat(api): split task list and detail endpoints feat(tasks): split list/detail endpoints + add updated_at recency sort Jun 25, 2026
@tildesrc tildesrc marked this pull request as ready for review June 25, 2026 23:45
@tildesrc tildesrc merged commit e3c435b into main Jun 25, 2026
1 check passed
tildesrc pushed a commit that referenced this pull request Jun 26, 2026
…dated_at)

Merge origin/main (#183): list_tasks now uses list_tasks_summary (lighter
query without full history). Combined with our asyncio.to_thread offload
so the DB query still doesn't block the event loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant