[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] images or video?

[Tool]
=== PATHS matching image/video-ish ===
  DELETE /auth/{providerID}                                      Remove auth credentials
  DELETE /experimental/worktree                                  Remove worktree
  DELETE /mcp/{name}/auth                                        Remove MCP OAuth
  DELETE /pty/{ptyID}                                            Remove PTY session
  DELETE /session/{sessionID}                                    Delete session
  DELETE /session/{sessionID}/share                              Unshare session
  GET    /api/session                                            List v2 sessions
  GET    /api/session/{sessionID}/message                        Get v2 session messages
  POST   /tui/select-session                                     Select session
  DELETE /experimental/workspace/{id}                            Remove workspace
  POST   /experimental/workspace/warp                            Warp session into workspace

=== SCHEMAS matching image/video-ish ===
  ImageAttachmentConfig
  AttachmentConfig
  WorktreeRemoveInput
  SyncEventMessageRemoved
  SyncEventMessagePartRemoved
  EventMessageRemoved
  EventMessagePartRemoved
  PromptFileAttachment
  PromptAgentAttachment
  PromptReferenceAttachment

=== schemas with "part" in name (message parts) ===
  TextPart
  SubtaskPart
  ReasoningPart
  FilePartSourceText
  FilePartSource
  FilePart
  ToolPart
  StepStartPart
  StepFinishPart
  SnapshotPart
  PatchPart
  AgentPart
  RetryPart
  CompactionPart
  Part
  TextPartInput
  FilePartInput
  AgentPartInput
  SubtaskPartInput
  SyncEventMessagePartUpdated
  SyncEventMessagePartRemoved
  EventMessagePartDelta
  EventMessagePartUpdated
  EventMessagePartRemoved

[Tool]
--- ImageAttachmentConfig ---
{
  "type": "object",
  "properties": {
    "auto_resize": {
      "type": "boolean"
    },
    "max_width": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "max_height": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "max_base64_bytes": {
      "type": "integer",
      "exclusiveMinimum": 0
    }
  },
  "additionalProperties": false
}

--- AttachmentConfig ---
{
  "type": "object",
  "properties": {
    "image": {
      "$ref": "#/components/schemas/ImageAttachmentConfig"
    }
  },
  "additionalProperties": false
}

--- PromptFileAttachment ---
{
  "type": "object",
  "properties": {
    "uri": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "source": {
      "$ref": "#/components/schemas/PromptSource"
    }
  },
  "required": [
    "uri",
    "mime"
  ],
  "additionalProperties": false
}

--- FilePart ---
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^prt"
    },
    "sessionID": {
      "type": "string",
      "pattern": "^ses"
    },
    "messageID": {
      "type": "string",
      "pattern": "^msg"
    },
    "type": {
      "type": "string",
      "enum": [
        "file"
      ]
    },
    "mime": {
      "type": "string"
    },
    "filename": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "source": {
      "$ref": "#/components/schemas/FilePartSource"
    }
  },
  "required": [
    "id",
    "sessionID",
    "messageID",
    "type",
    "mime",
    "url"
  ],
  "additionalProperties": false
}

--- FilePartInput ---
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^prt"
    },
    "type": {
      "type": "string",
      "enum": [
        "file"
      ]
    },
    "mime": {
      "type": "string"
    },
    "filename": {
      "type": "string"

... (truncated, 2747 total chars)

[Assistant] The path matches are mostly false positives (substring `image` inside `experimental`, `video` inside no, `attachment` inside `auth/`...). The real story is in the schemas — let me drill into the actual image/attachment types.

[Assistant]
Yes — **images, partially. Video, no.**

## Images: supported via `FilePart`

The mechanism is the standard multimodal-LLM pattern: a message is a list of parts (`TextPart`, `FilePart`, `ToolPart`, ...). To send an image you attach a `FilePartInput` to your message:

```python
FilePartInput(
    type="file",
    mime="image/png",        # or image/jpeg, image/webp, etc.
    url="<url or data: URI>",
    filename="screenshot.png",
)
```

Required fields are just `type`, `mime`, `url`. `url` can be a real URL or a `data:` URI (base64). Note the spec does NOT define an upload endpoint — there's no `multipart/form-data` anywhere in the API. **You either pass a URL the server can fetch, or inline the bytes as `data:image/png;base64,...` in the `url` field.** That's the actual transport.

Server-side handling is governed by `ImageAttachmentConfig` (config schema, not a runtime arg):
- `auto_resize: bool`
- `max_width`, `max_height` (px)
- `max_base64_bytes` (cap on inlined size)

So opencode-serve will downscale + size-bound images before shipping them to the underlying provider. Whether the *model* actually sees the image depends on the provider/model you've selected being vision-capable — opencode just brokers it.

There's also `PromptFileAttachment` (uri + mime + name + description + source). That's used in the *prompt* layer (slash-command / agent prompt attachments), not message parts — same idea, different surface.

## Video: not supported

Zero schemas, zero paths, no `video/*` mime appears anywhere in the spec. `FilePart.mime` is a free-form string so technically nothing stops you from sending `mime: "video/mp4"`, but:
1. No provider in opencode's stack today consumes video.
2. `ImageAttachmentConfig` is image-specific — no equivalent video config (max duration, transcode, frame extraction). So the server has no pipeline for it.

If you send video bytes today they'd at best be passed through to a provider that ignores them; at worst the inline-base64 size cap would reject the payload.

## Quick example — sending an image into a session

```python
import base64, pathlib
from opencode_client.models import FilePartInput, TextPartInput

img_bytes = pathlib.Path("/tmp/foo.png").read_bytes()
data_url = "data:image/png;base64," + base64.b64encode(img_bytes).decode()

parts = [
    TextPartInput(type="text", text="What's in this image?"),
    FilePartInput(type="file", mime="image/png", url=data_url, filename="foo.png"),
]
# ...then ship `parts` via the session message/chat endpoint
```

(The session-send endpoint takes a list of `*PartInput`s as the message body — check `src/opencode_client/api/session/` for the exact route; `session_chat` or similar.)

Tl;dr: **images yes (URL or data-URI, no upload endpoint), video no, audio no.** Text + images is the multimodal envelope opencode currently exposes.

[User] Ok harness mode operations

[Assistant] "Harness mode" isn't a term I recognize from opencode doctrine or our session context. Before I do anything, I need you to disambiguate — a few plausible reads:

[User] Controlling multiple agents remotely and cooridnating their efforts

[Assistant]
Got it — "harness mode" = use the opencode-serve API + our new generated client to drive multiple opencode agents from outside, coordinate their work, and aggregate their output. A control plane sitting *above* the agents rather than being one of them.

Before I start writing, a few things need to be pinned down because the design space is large and the mesh constraints matter:


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
fix(generate): skip local model validation when default_remote is set (#4)

'tsr generate -m <model> ...' without an explicit -r/--remote flag was
running _validate_model_available() against the local [comfyui] url
even when config.toml had default_remote pointing at a different host.
On a typical operator setup (default_remote = 'runpod', local comfyui
url stale or empty) this fails with 'Model X not available on ComfyUI
host (looked in checkpoints/ — 2 entries)' even though the model
exists on the remote and would be reachable for the actual dispatch
a few hundred lines later.

Root cause: two validation gates used the raw 'remote' parameter
(CLI flag only) instead of the resolved remote URL:
  - generate(): pre-fanout validation for --parallel-queue path
  - _run_generation(): per-call validation

Both now use do_resolve_remote(remote), which returns the resolved
URL when default_remote is set even if -r was omitted. The server-
side validator on the remote tensors API still catches missing
models on the remote host — matches the intent already documented
in the comment block.

Co-authored-by: marauder-actual <marauder@saiden.dev>

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(db-list): default to remote DB, add --local override (#3)

By default 'tsr db list' read from the LOCAL SQLite DB even when
default_remote was configured, which created a confusing UX where the
table never reflected the actual generation host. On a typical setup
(chi@fuji with default_remote='runpod') it would happily display ghost
entries pointing at /home/madcat/comfyui/models/... paths that don't
exist on macOS at all.

Flip the default:
  - 'tsr db list'           -> remote (when default_remote set), else local
  - 'tsr db list --local'   -> force local SQLite DB
  - 'tsr db list -r <name>' -> explicit remote (overrides default_remote)

Precedence: --local wins; else -r; else default_remote; else local.

Adds remote_db_files() helper in tensors/remote.py that calls the
existing GET /api/db/files server endpoint (no server-side changes
needed). Mirrors the pattern used by remote_models().

Scope kept minimal: only 'db list' for now. db search / triggers /
stats stay local-default; can flip later under the same pattern if
the UX wins are similar.

Co-authored-by: marauder-actual <marauder@saiden.dev>

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/remote.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] release: v0.1.26

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
fix(types): clear all 10 pre-existing mypy errors

Master CI lint job runs both ruff and mypy. Previous commit cleaned ruff;
this knocks out the mypy backlog too so the parallel-queue PR can ship
fully green.

- fragments.py: FragmentLibrary defines a `list()` method, which shadows
  the builtin in class-scope name resolution and broke `list[str]`
  annotations in `resolve()`. Qualify with `builtins.list` (imported
  under TYPE_CHECKING since it's static-only).
- remote.py: `result.get("civitai", result)` returns Any to mypy because
  dict.get widens. Capture into a typed local first.
- cli.py:
  - Drop redundant type re-annotation on `civitai_results` in the
    non-remote branch (same name was annotated in the early-return
    remote branch above; mypy treats class/module-scope re-annotation
    as no-redef even when control flow rules out overlap).
  - Guard `p.name is not None` before passing to `get_parameter_source`
    (click stubs type Parameter.name as `str | None`).
  - Parameterize bare `list | dict` in `_load_json_file_or_inline`.
  - Widen `_write_sweep_manifest`'s template_path arg to `Path | None`
    (callers already pass None when --list is used without --template);
    serialize as empty string in manifest to keep schema stable.
  - `# type: ignore[arg-type]` on the deprecated `tsr comfy generate`
    delegator that passes a typer function where click.Command is
    expected — duck-typed at runtime, only matters for the deprecation
    shim.

Tests: 374 still passing. Ruff: clean. Mypy: clean.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/fragments.py, tensors/remote.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
style: clear all 23 pre-existing ruff lint errors

Master had been failing CI lint since before this PR. Knock out the
backlog so the parallel-queue PR can ship green and future PRs don't
inherit the red baseline.

Changes by category:
- UP042 (9): Migrate `class Foo(str, Enum)` to `class Foo(StrEnum)` in
  tensors/config.py (7 enums) and tensors/server/search_routes.py (2).
  Requires Python 3.11+, already enforced by `requires-python = ">=3.12"`.
- PLR2004 (3): Extract magic comparison values in comfyui_api_routes.py
  to module-level constants (_DEFAULT_STEPS, _DEFAULT_CFG, _PROMPT_LOG_TRUNCATE).
- PLW0108 (2): Inline `lambda: StubDB()` -> `StubDB` in test_server.py.
- PLR0915 (3): Add explicit `# noqa: PLR0915` to typer command bodies
  that are intentionally long (template, templates_extract, _wait_for_completion_ws).
- PLR1714 (1): `file_path.name == model or file_path.stem == model` ->
  `model in (file_path.name, file_path.stem)` in cli.py:3047.
- SIM113 (1): Use `enumerate(as_completed(futures), start=1)` for the
  completion counter in style-sweep parallel loop.
- RUF059 (1): Prefix unused tuple-unpacked vars with `_` in _run_one.
- SIM105 (1): `try: ws.close() except Exception: pass` ->
  `contextlib.suppress(Exception)` in comfyui.py.
- PLC0415 (1): Add missing `# noqa: PLC0415` to the second of two
  function-scoped tensors.config imports.

No behavior changes. All 374 tests still pass.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/comfyui.py, tensors/config.py, tensors/server/comfyui_api_routes.py, tensors/server/search_routes.py, tests/test_server.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
style: clean lint warnings introduced by parallel-queue change

- Drop unused `import json` from new test module (F401).
- Remove unused `# noqa: BLE001` directives — project ruff config doesn't
  enable BLE001 so the suppressions were dead weight (RUF100 x3).
- Replace `×` (U+00D7) with ASCII `x` in console output (RUF001).
- Collapse seed-strategy if/else into ternary (SIM108).
- Use `enumerate(as_completed(...), start=1)` for completion counter
  instead of manual `completed = 0; completed += 1` (SIM113).
- Run `ruff format` on touched files.

Pre-existing lint errors on master (PLC0415/PLR0915/SIM113 in unrelated
commands) are untouched — separate cleanup PR if desired. Net delta of
this branch over master: 0 new lint errors.

All 374 tests still passing.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tests/test_generate_parallel.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] release: v0.1.25

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tests/test_generate_input.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(scene): add extract command and make main prompt optional

- Made the main prompt argument optional in generate and style-sweep
  if scene, scene_prompt, character, or character_prompt are provided.
- Added tsr scene extract <model> command to fetch a model's CivitAI
  showcase images and save their prompts as scenes in the local
  library. Prompts are deduplicated and saved as <model>_01.yml, etc.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(config): register diffusion_models as a first-class path key

ComfyUI keeps UNet-only Flux checkpoints under models/diffusion_models/
(paired with separate clip/ and vae/ files), distinct from the unified
models/checkpoints/. tsr previously had no way to track that directory
in its config — `tsr config --set-path diffusion_models=...` errored
because the CLI validator's allow-list only knew the 7 CivitAI-aligned
types (checkpoints, loras, embeddings, vae, controlnet, upscalers,
other). Workaround was a manual symlink from diffusion_models/ back
into checkpoints/, which is fragile (mixed link styles, breaks if the
target file is reorganised) and confuses `tsr models`/`tsr db list`
(same file shows up under two loader headings).

Changes:

- config.py: new VALID_PATH_TYPES constant as the single source of
  truth for keys accepted by `tsr config --set-path KEY=PATH`. Adds
  "diffusion_models" to the list and a synthetic "DiffusionModel"
  bucket in DEFAULT_PATHS pointing at MODELS_DIR/diffusion_models.
  Comment notes that CivitAI does not have a DiffusionModel
  model_type (UNet-only Flux files are returned as "Checkpoint"), so
  auto-routing from `tsr dl` will never pick this bucket — it exists
  for explicit `tsr dl -o /path/to/diffusion_models` workflows and for
  `tsr config --show` visibility into where the dir lives on disk.

- cli.py: imports VALID_PATH_TYPES and replaces the two duplicated
  inline lists (set-path validator + custom-marker display in the
  `config` command). No behaviour change for the existing 7 types.

After this lands and is `uv tool upgrade tensors`'d, users can
`tsr config --set-path diffusion_models=/path/to/comfyui/models/diffusion_models`
and `tsr dl -v <civitai-version-id> -o /path/to/diffusion_models` for
UNet-only Flux downloads, no more symlink workarounds.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/config.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(cli): resolve bare model/lora names to .safetensors silently

Before: `tsr generate -m lust_v10` failed validation with a 'did you mean'
hint pointing at 'lust_v10.safetensors'. Annoying because the bare name is
what the user typed and what `tsr models` prints back to them.

After: when the exact name misses and there is exactly one suffixed variant
in the target bucket (diffusion_models/ or checkpoints/), the validator
prints a dim '[Resolved 'X' \u2192 'X.safetensors']' line and substitutes the
canonical filename before forwarding to ComfyUI. Extensions tried in order:
.safetensors, .ckpt, .gguf, .pt, .bin. Same logic applies to LoRA names.

Ambiguous matches (multiple extensions present) still fail \u2014 the user must
disambiguate explicitly. Names that already contain a dot are left alone.

Function signature changes from -> None to -> tuple[str, str | None] so the
caller can pick up the resolved names.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/fragments.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/characters.py, tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(generate): drop automatic LoRA trigger word injection

Removes the --triggers/--no-triggers flag from generate, style-sweep, and
the deprecated comfy generate path. Trigger words are no longer auto-added
to prompts; users must include them explicitly. DB lookups remain available
via 'tsr db triggers' and /api/db/triggers for manual inspection.

Bumps version to 0.1.22.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py, tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tests/test_style_sweep.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] style: auto-fix ruff warnings [skip ci]

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tests/test_style_sweep.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] style: auto-fix ruff warnings [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tests/test_tensors.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
refactor(cli): extract _run_generation helper from generate

Move the post-merge body of generate() into a module-level _run_generation
helper so it can be invoked directly by other commands (next: style-sweep)
without going through Typer argv reconstruction.

No behaviour change. generate() still owns the --input JSON merge and CLI
parameter-source detection, then delegates to _run_generation.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
feat(generate): expose --guidance flag for Flux models

Threads guidance value through CLI → remote payload → server schema →
generate_image() → FluxGuidance node. Ignored for non-Flux families.

Use cases:
- Lower guidance (2.0-3.0) for looser, more photorealistic Flux output
- Higher guidance (4.0-6.0) for tighter prompt adherence

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/remote.py, tensors/server/comfyui_api_routes.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] release: v0.1.21

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] release: v0.1.20

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] style: auto-fix ruff warnings [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/cli.py, tensors/comfyui.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
Fix -m model flag causing 502 on /api/comfyui/generate

Family detection was force-injecting a default VAE (e.g. sdxl_vae.safetensors)
when a model was specified without an explicit --vae. If that VAE file didn't
exist on the ComfyUI server, the workflow was silently rejected. Now only
overrides VAE when the user explicitly passes --vae.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/server/comfyui_api_routes.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
Make CORS origins configurable via CORS_ORIGINS env var

Replaces hardcoded localhost origins with env-driven config.
Accepts comma-separated origins or wildcard (*). Defaults to
["*"] for backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/server/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] Release v0.1.19 - BSL baseline

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/__init__.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
Add model family-specific sampler, scheduler, and VAE defaults

- Add sampler/scheduler/steps/vae to MODEL_FAMILY_DEFAULTS for all families
- Add zimage family detection for ZImageTurbo models
- Flux and zimage families use ae.safetensors VAE
- SD 1.5 families use checkpoint built-in VAE
- SDXL families use sdxl_vae.safetensors
- API auto-applies family defaults when request uses default values

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/comfyui.py, tensors/config.py, tensors/server/comfyui_api_routes.py, tests/test_tensors.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User] format: auto-format code [skip ci]

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/server/comfyui_api_routes.py.


[System]
You are a Python coding agent. Execute implementation tasks precisely and completely.

## Constraints

- Type hints on ALL new function signatures (params + return)
- `pathlib.Path` over `os.path` for filesystem operations
- `uv` for dependency management if `pyproject.toml` present — never raw `pip install`
- Pydantic v2 for data models (no v1 `BaseModel` patterns: `.dict()` → `.model_dump()`)
- `pytest` + `pytest-asyncio` for testing — no `unittest`, no `nose`
- `ruff` for lint + format — respect existing `ruff.toml` / `pyproject.toml [tool.ruff]`

## Workflow

1. Read `pyproject.toml` (or `setup.py`, `requirements.txt`) to understand deps and tooling
2. Check for `ruff.toml`, `.flake8`, `mypy.ini` — respect existing lint config
3. Match existing style — run `git log -5 --oneline` for commit convention
4. Implement with focused, minimal diffs
5. Run `ruff check .` — fix violations
6. Run `ruff format .` — apply formatting
7. Run `pytest` (or project-specific test command) — fix failures
8. If `mypy` is configured: run `mypy --strict <changed_paths>` — fix type errors

## Verification

After every change cycle:
```
ruff check .
ruff format --check .
pytest                    # (or project-specific test command)
```

If mypy is in the project's dev dependencies, also:
```
mypy --strict <changed_files>
```

All must pass before reporting success.

## Framework Detection

Check project structure:
- `app/` + `manage.py` → Django
- `app.py` or `main.py` with `Flask` import → Flask
- `main.py` with `FastAPI` → FastAPI (use `uvicorn` to test-run)
- `noxfile.py` → use `nox` for test orchestration
- `tox.ini` → use `tox` for test orchestration

Follow the framework's conventions for route definitions, middleware, configuration.

## Commit Style

- Stage only changed files: `git add <paths>`
- Match repo's format (check `git log -5 --oneline`)
- Common format: `<type>(<scope>): <subject>`

## Memory Trail

After completing work, store results:
- What you built, file paths, key decisions → subject: `project.<name>.build-result`
- Anything unresolved or worked around → subject: `project.<name>.unresolved`
- Things you noticed out of scope → subject: `project.<name>.out-of-scope`
- Bugs found and how you fixed them → subject: `project.<name>.errors`

[User]
Add LoRA support to generate API endpoint

- Add lora_name and lora_strength parameters
- Include LoRA info in request logging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

[Tool] Edit applied successfully.

[Assistant] Applied changes to tensors/server/comfyui_api_routes.py.