azurenoops / azurenoops/spin_agent

[BUG] [Systems] - No delete capability for systems — QA test systems accumulate as orphans (58 systems, 19+ orphans)

Open
#615 1 comment 0 reactions 1 assignee Claimed by @jrspinella View on GitHub
agent:oracle area:rmf bug priority:high
Dominant language
C#
Stars
3
Forks
1
Avg merge
11h 20m
Merged PRs (30d)
70

Description

## Bug Description

There is no API endpoint and no UI mechanism to delete a registered system. This causes orphaned "QA Test System" records to accumulate indefinitely with no way to clean them up.

As of this sweep (2026-07-05T06:40:00Z), the system count is 58+ with 19+ orphaned QA Test Systems from prior sweeps. The count grows by at least 1 per QA sweep every 4 hours.

This is distinct from issue #559 (which covers 'In Setup' wizard cancel orphans) — this affects fully registered systems that cannot be deleted by any means.

## Steps to Reproduce

1. Register any system via MCP chat or UI wizard
2. Attempt to delete it via REST: `DELETE /systems/{id}` → HTTP 404
3. Attempt to delete it via MCP chat: "Delete system {name}" → `SYSTEM_REQUIRED` disambiguation loop (never executes delete)
4. Check `compliance_list_systems` — no delete tool exists among 237 registered MCP tools
5. Result: system is permanent

## Expected Behavior

- `DELETE /systems/{id}` REST endpoint should return 200 and remove the system
- OR MCP chat should support "delete system {name}" intent
- OR UI should show a delete button on system detail page

## Actual Behavior

- No `DELETE /systems/{id}` REST route exists (HTTP 404)
- No `compliance_delete_system` or equivalent tool in the MCP tool registry (237 tools checked)
- MCP chat "delete system X" returns `SYSTEM_REQUIRED` disambiguation — never reaches a delete tool
- No delete button visible in system detail UI

## Impact

- QA sweeps running every 4 hours each create 1+ test system per run
- After 6+ days of sweeps: 58 total systems, 19+ are orphaned QA debris
- Disambiguation noise: `SYSTEM_REQUIRED` response lists all 58 systems on every chat query, making the AI agent unusable
- No path to remediation without direct database access

## Affected Systems (Orphaned — Require Manual DB Cleanup)

- qa test system 2026-07-05t06:39:30z (created this sweep, cannot delete)
- QA Test System 2026-07-05T02:22:00Z
- QA Test System 2026-07-04T22:07:00Z
- QA Test System 2026-07-04T13:44:03Z
- QA Test System 2026-07-04T05:18:00Z
- QA Test System 2026-07-04T01:05:00Z
- QA Test System 2026-07-03T08:15:00Z
- QA Test System 2026-07-02T23:42:00Z
- QA Test System 2026-07-02T06:43:00Z
- QA Test System 2026-07-02T02:27:26Z
- QA Test System 2026-07-01T18:08:00Z
- QA Test System 2026-07-01T13:50:00Z
- QA Test System 2026-07-01T09:30:00Z
- QA Test System 2026-07-01T05:15:00Z
- QA Test System 2026-07-01T00:58:00Z
- Multiple "New System" records (from #593 misrouting bug)

## Console/API Evidence

```
# REST DELETE attempt:
curl -s -X DELETE "$BASE/systems/{ID}" → HTTP 404

# MCP tool scan - no delete system tool found:
curl -s "$BASE/mcp/tools" → 237 tools, zero with "delete system" or "unregister system"

# MCP chat attempt:
POST /mcp/chat {"message":"Delete system QA Test System 2026-07-05T02:22:00Z"}
→ SYSTEM_REQUIRED (disambiguation loop, never executes)
```

## Playwright Test Code

```typescript
test('[systems] delete system removes it from list', async ({ page }) => {
// Register a test system
const response = await fetch(`${BASE}/mcp/chat`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: 'Register a new system named QA-DELETE-TEST' })
});
// Attempt REST delete
const deleteResp = await fetch(`${BASE}/systems/{id}`, { method: 'DELETE' });
expect(deleteResp.status).toBe(200); // FAILS: returns 404
});
```

## Browser/Environment

MCP API: https://ca-ato-copilot-mcp-v2.blackwater-9393aa1a.centralus.azurecontainerapps.io
Dashboard: https://ca-ato-copilot-dashboard-v2.blackwater-9393aa1a.centralus.azurecontainerapps.io
Date: 2026-07-05T06:40:00Z
Sweep: Automated 4-hour QA sweep

*Filed by Oracle — Automated 4-hour QA Sweep 2026-07-05T06:40:00Z*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.