ListTasks no longer appends the SQL literal AND archived=0. The default unarchived view binds archived=? to a Go false, which PostgreSQL accepts on a BOOLEAN column and SQLite still stores as 0/1.
openTestStore builds search_path for both URL DSNs (with or without an existing query) and keyword DSNs, and keeps public so an already-installed pg_trgm stays visible.
Why
GET /api/conversations (includeArchived=false) hit boolean = integer (SQLSTATE 42883) on the postgres tier and the handler returned 500. The previous dialect fix covered parameter binding and scans, not this literal.
Evidence
Before: TestConversationFlagsAndTaskList with AGENT_PG_TEST_DSN pointed at pg1 failed with operator does not exist: boolean = integer (SQLSTATE 42883).
After: same test and go test ./internal/store -count=1 passed on pg1. go vet ./... && go test ./... -count=1 passed on SQLite.
Test plan
SQLite go vet ./... && go test ./... -count=1
pg1 AGENT_PG_TEST_DSN=<pg1> go test ./internal/store -count=1
After the Dev gitlink bump is deployed: GET /api/conversations returns 200
## Summary
- `ListTasks` no longer appends the SQL literal `AND archived=0`. The default unarchived view binds `archived=?` to a Go `false`, which PostgreSQL accepts on a BOOLEAN column and SQLite still stores as 0/1.
- `openTestStore` builds `search_path` for both URL DSNs (with or without an existing query) and keyword DSNs, and keeps `public` so an already-installed `pg_trgm` stays visible.
## Why
`GET /api/conversations` (includeArchived=false) hit `boolean = integer` (SQLSTATE 42883) on the postgres tier and the handler returned 500. The previous dialect fix covered parameter binding and scans, not this literal.
## Evidence
- Before: `TestConversationFlagsAndTaskList` with `AGENT_PG_TEST_DSN` pointed at pg1 failed with `operator does not exist: boolean = integer (SQLSTATE 42883)`.
- After: same test and `go test ./internal/store -count=1` passed on pg1. `go vet ./... && go test ./... -count=1` passed on SQLite.
## Test plan
- [x] SQLite `go vet ./... && go test ./... -count=1`
- [x] pg1 `AGENT_PG_TEST_DSN=<pg1> go test ./internal/store -count=1`
- [ ] After the Dev gitlink bump is deployed: `GET /api/conversations` returns 200
Refs: Agent-System-Dev feature/store-pg-archived-literal
Why: GET /api/conversations on the default unarchived view appended
AND archived=0. PostgreSQL stores conversations.archived as BOOLEAN
and rejects boolean = integer (42883), so listTasks returned 500.
The previous dialect fix bound parameters and scans but left this literal.
Evidence: before the change, TestConversationFlagsAndTaskList against
pg1 failed with SQLSTATE 42883. After: AGENT_PG_TEST_DSN set to pg1,
go test ./internal/store -count=1 passed; go vet ./... && go test ./...
passed on SQLite.
Impact: the default task list works on the postgres tier. SQLite still
binds the bool as 0/1. openTestStore accepts URL and keyword DSNs and
keeps public on search_path so an existing pg_trgm extension stays visible.
Refs: Agent-System-Dev feature/store-pg-archived-literal
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen
merged commit 4136bdcbbb into main2026-10-05 03:21:13 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
ListTasksno longer appends the SQL literalAND archived=0. The default unarchived view bindsarchived=?to a Gofalse, which PostgreSQL accepts on a BOOLEAN column and SQLite still stores as 0/1.openTestStorebuildssearch_pathfor both URL DSNs (with or without an existing query) and keyword DSNs, and keepspublicso an already-installedpg_trgmstays visible.Why
GET /api/conversations(includeArchived=false) hitboolean = integer(SQLSTATE 42883) on the postgres tier and the handler returned 500. The previous dialect fix covered parameter binding and scans, not this literal.Evidence
TestConversationFlagsAndTaskListwithAGENT_PG_TEST_DSNpointed at pg1 failed withoperator does not exist: boolean = integer (SQLSTATE 42883).go test ./internal/store -count=1passed on pg1.go vet ./... && go test ./... -count=1passed on SQLite.Test plan
go vet ./... && go test ./... -count=1AGENT_PG_TEST_DSN=<pg1> go test ./internal/store -count=1GET /api/conversationsreturns 200Refs: Agent-System-Dev feature/store-pg-archived-literal