HKUDS/DeepTutor · error · HTTPException

Tag not found

Error message

Tag not found: {tag}

What it means

Lookup guard in PUT /tags/{tag}: the path tag does not exist in the service, so rename has no target. The message echoes the requested tag so the client can spot stale references.

Solutions

  1. GET /tags/list first and rename using an existing tag
  2. Client: on 404, refresh the tag list — the tag may have been renamed or deleted elsewhere
  3. Create the desired tag fresh if the old one is gone and the new name is what you want long-term
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at deeptutor/api/routers/skills.py:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/00e389b812eb4e1f. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/api/routers/skills.py:101

@router.post("/tags/create")
async def create_tag(payload: CreateTagRequest) -> dict[str, str]:
    service = get_skill_service()
    try:
        tag = service.create_tag(payload.name)
    except TagExistsError as exc:
        raise HTTPException(status_code=409, detail=f"Tag already exists: {exc}")
    except InvalidTagError as exc:
        raise HTTPException(status_code=400, detail=str(exc))
    return {"name": tag}


@router.put("/tags/{tag}")
async def rename_tag(tag: str, payload: RenameTagRequest) -> dict[str, str]:
    service = get_skill_service()
    try:
        new_tag = service.rename_tag(tag, payload.rename_to)
    except TagNotFoundError:
        raise HTTPException(status_code=404, detail=f"Tag not found: {tag}")
    except TagExistsError as exc:
        raise HTTPException(status_code=409, detail=f"Tag already exists: {exc}")
    except InvalidTagError as exc:
        raise HTTPException(status_code=400, detail=str(exc))
    return {"name": new_tag}


@router.delete("/tags/{tag}")
async def delete_tag(tag: str) -> dict[str, str]:
    service = get_skill_service()
    try:
        service.delete_tag(tag)
    except TagNotFoundError:
        raise HTTPException(status_code=404, detail=f"Tag not found: {tag}")
    except InvalidTagError as exc:
        raise HTTPException(status_code=400, detail=str(exc))
    return {"status": "deleted", "name": tag}

View on GitHub (pinned to 3e82f13042)