Skip to content

Retest queue items never transition to completed — TUI shows stale pending items #82

Description

@badchars

Bug Summary

During web penetration testing, the retest queue accumulates pending items in the TUI but never clears them after inspection is complete. The agent claims items are processed ("should be cleared now") but the TUI still shows all items as pending.

Root Cause

WebRetest.updateStatus() and WebRetest.next() are defined in packages/cyberstrike/src/session/web/web-retest.ts but never called from anywhere in the codebase. The retest queue lifecycle is incomplete:

  • Enqueue works: WebRetest.checkTriggers() is called from web-write-object-value.ts:54 and web-write-role.ts:54, creating items with status: "pending"
  • TUI display works: WebRetest.getPending() and WebRetest.count() are read by the server route (session.ts:1022-1023) and web_get_session_context tool
  • Consumption is broken: No code ever calls updateStatus(id, "processing") or updateStatus(id, "completed") — items stay "pending" forever

Additionally, there is no agent-facing tool to dequeue or complete retest items. The agent can see the queue via web_get_session_context(include: ["retest_queue"]) but has no mechanism to mark items as done.

Steps to Reproduce

  1. Run a web pentest session with hackbrowser against any target with multiple credentials
  2. Let the proxy-analyzer discover objects/roles — this triggers WebRetest.checkTriggers() via web_write_object_value and web_write_role
  3. Observe the TUI showing pending retest items (e.g. "25 HTTP requests pending")
  4. Let the agent complete its testing cycle
  5. Observe the TUI still showing the same pending items — they never clear

Expected Behavior

Retest queue items should transition through pending → processing → completed as the agent works through them. Completed items should no longer appear in the TUI pending count.

Affected Files

  • packages/cyberstrike/src/session/web/web-retest.tsupdateStatus() (L146) and next() (L162) are dead code
  • packages/cyberstrike/src/tool/web-get-session-context.ts — exposes queue to agent (read-only, no write)
  • packages/cyberstrike/src/tool/web-write-object-value.ts — enqueues retests (L54)
  • packages/cyberstrike/src/tool/web-write-role.ts — enqueues retests (L54)
  • packages/cyberstrike/src/server/routes/session.ts — TUI reads pending items (L1022-1023)

Suggested Fix

  1. Wire WebRetest.next() into the ingest/processing pipeline so items are dequeued and processed
  2. Call WebRetest.updateStatus(id, "completed") after the agent finishes testing each request
  3. Consider adding a web_complete_retest tool (or extending an existing tool) so the agent can mark items as done
  4. The Bus event (web_retest.updated) already propagates to the TUI — once updateStatus is called, the TUI will update automatically

Priority

High — this is a user-visible bug that makes the TUI unreliable during active pentest sessions. Users lose trust in the queue status and cannot tell which items still need attention.

Labels

bug, web-testing, tui

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