Skip to content

Retest queue items are never processed — write-only data structure #74

Description

@badchars

Summary

The retest queue (web_retest_queue table) accumulates items but nothing ever dequeues or processes them. The agent declares "test complete" while dozens of high-priority retest items remain pending.

Root Cause

Five interconnected gaps:

1. No consumer exists

WebRetest.next() is defined in src/session/web/web-retest.ts but never called anywhere in the codebase. No dequeue loop, no IngestQueue integration, no processing pipeline.

2. Orchestrator prompt makes a false promise

src/agent/prompt/orchestrator/web-proxy-agent/prompt.txt Step 7 says:

"Check web_get_session_context for pending re-tests. If there are high-priority items, the system will feed them as new requests."

No such system exists.

3. Agent has no tools to process retests

The proxy-agent's permission set has no ability to update retest status, re-ingest requests, or enqueue anything into IngestQueue.

4. Completion check ignores retest queue

IngestQueue considers itself done when pending === 0 (queued HTTP requests). It never queries WebRetest.count() or WebRetest.getPending() before declaring finished.

5. Per-request isolation

Each ingest invocation uses excludeHistory: true — the orchestrator has no accumulated awareness that a retest queue is growing across requests.

How items accumulate

  • web_write_object_value tool → WebRetest.checkTriggers() → up to 20 retest items per trigger (priority: high when related object IDs exist)
  • web_write_role tool → WebRetest.checkTriggers() → up to 20 retest items per trigger (priority: medium)
  • new_credential trigger type is defined but never called from any code

Observed behavior

43 retest items marked "high pending" in TUI sidebar while agent reports test complete.

Proposed fix

A) Auto-retest pipeline — After IngestQueue drains, automatically feed pending retest items back as new ingest tasks. Most robust.

C) Completion gate — Block "test complete" signal until retest queue is empty or explicitly skipped.

Both A and C should be implemented together.

Affected files

  • src/session/web/web-retest.ts — WebRetest.next() exists but unused
  • src/session/ingest-queue.ts — No retest awareness
  • src/agent/prompt/orchestrator/web-proxy-agent/prompt.txt — False "system will feed" claim
  • src/tool/web-write-object-value.ts — Trigger source
  • src/tool/web-write-role.ts — Trigger source
  • src/tool/web-get-session-context.ts — Retest queue only shown on opt-in

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