Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Weekly refresh-local-llm-catalog job logs two 'Task not found' faults per run

Closed
#12,875 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@atomantic is already working on this.

Since Oct 22, 2026.

  • #12893 by @atomantic — merged

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
backend, testing

Research direction

Trace the cosJobScheduler spawn path and generateTaskFromJob() in server/services/autonomousJobs/skillTemplates.js, then inspect the claim and finalization writes in server/services/agentSpawnDispatch.js and server/services/agentFinalization.js. Start by adding the regression test from the decision section to check whether the job task exists in the internal store at claim time. The fix is done when scheduled runs stop logging Task not found, deletion of a persisted running task still warns, and run history and task status stay unchanged.

Written by the indexing model from the issue text.

Description

area:cos-agents bug effort:medium model:medium plan planner:sonnet-5-5

Problem

The weekly refresh-local-llm-catalog autonomous job logs two stderr faults on every run:

⚠️ in_progress claim for task job-refresh-local-llm-catalog-<ts> returned an error (taskType=internal): Task not found
⚠️ Failed to update completed task job-refresh-local-llm-catalog-<ts>: Task not found (taskType=internal)

Evidence (PM2 server error log, last 30 days): 14 Task not found task-update lines; 11 are this job, on three consecutive Mondays at the same hour (the job's weekly cadence). The rest are app-improve-* / self-improve-* tasks updated after the user deleted them mid-run, which is a legitimate "task vanished" case.

Both lines come from updateTask(task.id, …, 'internal') returning { error: 'Task not found' }:

  • server/services/agentSpawnDispatch.js — the in_progress claim right after the agent initializes.
  • server/services/agentFinalization.js — the terminal status write (Failed to update <label> task …).

The job's task is built by generateTaskFromJob() in server/services/autonomousJobs/skillTemplates.js (its id is <job.id>-<base36 timestamp>). Hypothesis to verify first: that synthetic task reaches spawnAgentForTask without ever being written to the internal task store (or is removed before the claim), so both status writes are no-ops reported as faults.

This surfaced while re-leveling stderr logging in #12850: a line that fires every week for a healthy scheduled job is not "investigate" material, but a task that really vanished mid-run still is.

Decision

  1. Add a regression test that drives the cosJobScheduler spawn path for a skill-template job and asserts whether the task exists in the internal store at claim time.
  2. If job tasks are meant to be persisted before spawn, persist this one (fix the ordering). If they are intentionally ephemeral, skip the updateTask status writes for a non-persisted job task (look it up first) so neither line is emitted.
  3. Keep the warn for a persisted task that disappears mid-run (user delete), which is the case worth surfacing.

Acceptance criteria

  • A weekly refresh-local-llm-catalog run emits no Task not found line.
  • Deleting a running persisted task still logs the Failed to update … Task not found warn.
  • The job's run history and task status are unchanged by the fix.

Related to #12850. Dispatch rationale: model:medium and effort:medium — a routine multi-file lifecycle trace; neither axis is stretched.

Dominant language
JavaScript
Stars
38
Forks
32
Avg merge
44m
Merged PRs (30d)
990

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomantic/PortOS

All issues in atomantic/PortOS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.