Skip to content

materialize_typed makes no model call but is still claimed as model work #1351

Closed

Description

@WaylandYang

Follows #1300 and #1349.

What happens, and what you expected

job_priority(kind) from migration 0116 puts materialize_typed (phrase_bindings::MATERIALIZE_KIND) at priority 1, with the model work. It is pure store work: it reads bindings and writes typed rows, and never calls the chat endpoint. So a person's phrase decision on the review page still waits behind the whole extraction backlog, and #1349's two reserved slots do not take it either, because the lane claims only job_priority(kind) = 0.

Expected: a job that makes no model call is claimed as intake, so a human decision materializes within seconds whatever the extraction queue holds.

Fix

A new migration with CREATE OR REPLACE FUNCTION job_priority returning 0 for materialize_typed, and a rebuild of the partial index on (job_priority(kind), run_at) WHERE status = 'queued', since the index is on the function's result. Worth checking the rest of the kind list at the same time for other jobs that touch no model (embedding jobs do call the endpoint and stay where they are).

Version

dev after #1349.

Activity

  1. Aschenbath commented on Oct 21, 2026

    @Aschenbath
    Contributor

    I’m taking this on. I’ll add a migration that classifies materialize_typed as intake and rebuilds the priority index, check the other registered job kinds, and add a database regression for claiming materialization ahead of queued model work. I’ll run the workspace tests and strict clippy before opening a PR against dev.

  2. WaylandYang commented on Oct 29, 2026

    @WaylandYang
    ContributorAuthor

    Fixed by #1358: a human phrase decision's materialization is claimed as intake, not model work (migration 0123).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions