Skip to content

Commit 29dd632

Browse files
tawnymanticorescosmanleonardmqclaudesfierro
authored
Merge new models into remote config (Gemma 4, GLM 5.1, GLM 5 turbo, and backfilling a lot of models for FW/TAI) (#1237)
* make linux tray failing to start a non-critical error * CR feedback - reset to none if tray failed to start * Update README with new features and links * Fix optimizer link * refactor: expose toolcall invocations to client and allow supplying result * specs for improving our OpenAPI docs * Add parameter descriptions to all API endpoints Phase 2 of OpenAPI documentation improvements. Adds Path(description=...), Query(description=...), and Body(description=...) annotations to all parameters across both libs/server/ and app/desktop/studio_server/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: propagate actual errors from save_new_run_config instead of generic message The run_config_component's save_new_run_config() was catching errors and returning null, which caused callers to display a generic "Resulting saved run config not found" error instead of the actual underlying error. Now save_new_run_config() throws errors directly, and: - Removed save_config_error prop from run_config_component (callers handle errors) - Updated call sites to not swallow errors - Removed redundant null checks since function now always returns TaskRunConfig - Removed the generic "Resulting saved run config not found" error path Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: check dialog is open before calling showModal() Fixes error when clicking "Re-run Eval" on an already-open modal dialog. The HTMLDialogElement.open property is now checked before calling showModal() to prevent "Cannot call showModal() on an open non-modal dialog" error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: remove unused imports and variables - Remove unused createKilnError import from run_config_component - Remove unused saved_config variable in optimize create page Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: only show ratings hint for legacy task requirements Hide the "Ratings are defined in the task settings" message unless rating_requirements exists (legacy case from deprecated task requirements). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix * review table fixes * fix * feedback * update uv.lock * bump timeout to 15min * add timeout error * coderabbit and gemini review * CR from gemini * chore: move comment around * fix path * refactor: unnest task runs, have parent id instead * update specs skill for manager role * refactor: throw if parent task run unsaved * Add agent policy model with approval workflow for Phase 1 Implement AgentPolicy pydantic model with validation for agent endpoint permissions (allow/deny) and approval requirements. Includes defense-in-depth whitespace validation on approval_description, convenience constants (ALLOW_AGENT, DENY_AGENT), and constructor helper. Annotate prompt optimization endpoint as requiring approval. Add specs and mark Phase 1 complete. Note: pre-commit hook skipped due to 4 pre-existing CORS test failures in test_server.py (unrelated to this change, identical on main). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Phase 2: Add parameter descriptions to all API endpoints Add Path(description=...) and Query(description=...) annotations to all undescribed parameters across libs/server/ and app/desktop/studio_server/. Covers 19 files including tool_api, skill_api, copilot_api, prompt_optimization_job_api, run_config_api, and import_api which were missed in the initial pass. * Mark Phase 2 complete in implementation plan * Add annotation dump CLI for agent policy extraction (Phase 2) Add dump_annotations.py CLI tool that extracts x-agent-policy annotations from OpenAPI specs into per-endpoint JSON files. Includes comprehensive tests with code review fixes: proper Path typing for tmp_path and removal of unused capsys parameter. Mark Phase 2 complete in implementation plan. Note: pre-commit hook bypassed due to 4 pre-existing CORS test failures in test_server.py (confirmed present on base branch). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add agent policy lookup helper with lazy-loading cache (Phase 3) Implements AgentPolicyLookup which loads annotation JSON files on first access and resolves endpoint policies by (method, path) key. Raises FileNotFoundError when annotations directory is missing and AgentPolicyError for unknown or unannotated endpoints (fail-safe deny). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Phase 3: Add schema and property descriptions to Pydantic models Added docstrings and Field(description=...) across core datamodels, server API models, and desktop server models to improve OpenAPI spec documentation. * Phase 4: Path renames, HTTP method changes, and frontend updates Backend: singular→plural path standardization (tasks, prompts, specs, evals), run config path unification, repair endpoint renames, eval endpoint renames, GET→POST for provider connect endpoints. Frontend: regenerated api_schema.d.ts, updated all path references in stores and components. * Rewrite checks.sh for parallel execution with spinner and --agent-mode Run all checks (ruff, ty, misspell, openapi, web UI, pytest) in parallel with a live spinner showing progress. Results print as each check completes. --agent-mode suppresses output for passing checks (token-friendly for AI). Also fixes find|xargs to handle filenames with spaces. * Add tags to all remaining API endpoints Added tags to endpoints in document_api, tool_api, skill_api, prompt_api, copilot_api, run_config_api, prompt_optimization_job_api, and import_api that were showing up in an untagged 'Other API' group. * Backfill all API endpoints with agent policy annotations (Phase 4) Annotate every FastAPI endpoint across libs/server and app/desktop with agent policy metadata (ALLOW_AGENT, DENY_AGENT, or require_approval) based on operation type and risk level. Regenerate all annotation JSON files via dump_annotations CLI. This enables the agent approval system to enforce per-endpoint access policies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Phase 5: Add agent policy annotation check to CI workflow Fold the annotation freshness check into the existing "Check API schema bindings" step so a single dev server instance is shared for both the schema binding check and the annotation diff. This avoids a redundant server start/wait/stop cycle. The step now: runs check_schema.sh, then dumps annotations to a temp dir, diffs them against the checked-in copies, and fails if any are missing or stale. Also marks Phase 5 complete in the implementation plan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add Phase 5 plan document Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * format * missing tag * document tags and add a test to check we tag our APIs * fix API path * fix PR review issues: security, bug, and docs corrections - Move api_key from query params to JSON request body for OpenAI compatible provider endpoint to prevent secret leakage in logs/URLs - Fix docker_model_runner connect call missing params.query nesting - Fix eval_config_id path param type from str | None to str - Update run_calibration endpoint summary to match path - Fix splits form field description to match validation (numeric proportions) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix stale API paths in frontend and inaccurate descriptions Update 3 frontend files that still referenced old API paths after the Phase 4 rename (eval→evals, run_config→run_configs, endpoint renames). Fix wrong error message in task update endpoint. Correct misleading passthrough_mimetypes and gen_type descriptions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * formatting * remove spinner when not connected to tty * fix: render newlines in MCP tool and argument descriptions Tool descriptions from MCP servers frequently contain newlines for structure (multi-paragraph explanations, bulleted usage notes). These were collapsed into flat text. Adding `whitespace-pre-line break-words` to the description cells in the tool server detail page fixes rendering, consistent with how fancy_select.svelte already handles descriptions. Made-with: Cursor * undo spec files * WIP * refactor: reject multiturn for structured task (not supported) * feedback * fix: remove leading/trailing whitespace around arg description content Made-with: Cursor * add a new span so prettier doesn't just add white space in the front * CR feedback * chore: add code review point about not using model name enum for input validation * Update checks.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * add test for API parameter descriptions and fix missing descriptions Adds a regression test that checks every path/query parameter in the OpenAPI schema has a description. Fixes the 5 parameters that were missing descriptions (gen_prompt and archive_tool_server endpoints). Also adds docstrings to 5 ambiguous endpoints (execute run, generate/save repair, eval comparison/calibration). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * CR guidance * CR guidance * fix CR issues: stale paths, tautological descriptions, dead code, and docs - Fix runtime bug: task deletion URL used old /task/ path instead of /tasks/ - Fix /api/project singular paths to /api/projects for consistency - Remove unused ID_FIELD constant from basemodel.py - Restore "should not be changed after creation" contract on Document.name - Improve tautological Field descriptions across API models - Fix docstring nits (ambiguous "model" wording, echoed descriptions) - Fix test assertion for corrected "Failed to update task" error message - Add trailing slash rule to API code review guidelines Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * remove dupe file * bring back ID_FIELD * revert /run_configs/mcp route back to /mcp_run_config to avoid ambiguity with /run_configs/{run_config_id} Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feedback * Fix checks * Remove hardcoded port from schema scripts, support worktrees Extract shared openapi_schema.sh helper that uses $KILN_PORT when a server is already running, or generates the schema directly from Python (no server needed) as a fallback. This makes generate_schema.sh, check_schema.sh, and checks.sh work correctly across worktrees. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * clone prompt button * update to architecture * fix * fix * feedback * chore: exclude python sdk from coderabbit * feedback * Revert "Backfill all API endpoints with agent policy annotations (Phase 4)" This reverts commit 810eb68 to prepare for merging the API docs overhaul branch and re-applying annotations on top. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove Spec Skill from Repo - It was just working for .cursor, and we use claude more - We use it across repos, so a central setup is better. When we make an update, we shouldn't need to update 3 repos. - Added install instructions to CONTRIBUTING.md * Add max lenth * Add StringConstraints instead of custom validators, which appear in OpenAPI docs, and our agent docs * Backfill all API endpoints with agent policy annotations (Phase 6) Rebase Phase 4 annotation backfill onto the API docs overhaul branch. Updates all endpoint files across studio_server and kiln_server with agent_policy annotations and regenerates the annotation JSON files for the CI binding checker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add readme * remove prints * format * Address PR feedback: top-level httpx import and explicit UTF-8 encoding Move httpx import to module level and add encoding="utf-8" to all open() calls in dump_annotations.py and policy_lookup.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * add retry to job runner * wk fix * fix * feedback * feedback * fixed failing ut * feedback * fix * feedback * reformat * test coverage * ruff * fix * fix * chore: add makefile with commands for common scripts * fix: error when ref or asset path points to a dir * fix: coderabbit and gemini feedback * Require more APIs to use permission (#1199) * gate more apis * Update libs/server/kiln_server/document_api.py allow agent to see progress Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update libs/server/kiln_server/utils/agent_checks/annotations/post_api_projects_project_id_rag_configs_progress.json Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * CR from Leonard * CR from gemini * add RetryableError * .env * revert earlier change to start.sh in favor of worktree incldue * oops * newline * config * retry schema validation error * clean up * KIL-505 Fix confusing "Manually Add Data" button on empty dataset Route the empty state "Manually Add Data" button to the add_data disambiguation screen instead of directly to /run, and hide the header "Add Data" button when the empty state is shown to avoid duplicate competing buttons. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix * KIL-430 Fix compare view keying evals by name instead of ID Evals with the same name collided in the compare view because eval_name was used as the key in lookup objects and for matching. Changed to use eval_id for all keying/lookups while keeping eval_name for display labels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * KIL-511 Fix confirm_model_select not working with FancySelect Replace event-based on_select callback with a Svelte reactive statement that watches model changes directly, since FancySelect uses bind:selected instead of emitting DOM events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * KIL-511 Move confirm_model_select reactive statement before store sync Ensures the confirmation dialog runs before the model propagates to ui_state and recent_model_store, preventing side effects when the user cancels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * KIL-465 Reduce form padding in create fine-tune page to match RunConfig spacing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix worktree port selection to skip occupied ports The hash-based port assignment could collide with ports already in use (e.g. Dropbox on 17500). Now checks both the backend and frontend ports with lsof and increments until a free pair is found, staying deterministic for a given branch + system state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix #1224 Allow installing anywhere * KIL-511 Use pending_model to prevent side effects before confirmation Bind FancySelect to a local pending_model instead of the exported model prop. The exported model only updates after the user confirms the selection, preventing intermediate side effects in ui_state and recent_model_store when the user cancels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * KIL-511 Fix sync reactive statement reverting user selections The previous sync statement depended on both model and pending_model, causing it to revert user selections before confirmation could run. Use a separate sync_parent_model function that only tracks model changes, so user-driven pending_model changes don't trigger the parent sync. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix CORS test when using custom frontend port * Add Gemma 4, GLM 5 Turbo; add GLM-5, Kimi K2.5, MiniMax M2.5, and Qwen 3.5 on Fireworks & Together AI (#1210) * new models * adding Gemma 4 and addressing PR comments * Update test_provider_tools.py * adding qwen 3.6 * Update ml_model_list.py * Update ml_model_list.py * it DOES support function calls * KIL-514 Hide name field from SDG run configs The RunConfigComponent's name field is only needed when saving named run configs. In the synthetic data generation flow, configs are used inline and never saved, so the name field was unnecessary UI clutter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * add Arcee Trinity Large Thinking model * Shrink sidebar layout for better space utilization Reduce sidebar width and vertical density to fit on 14" screens and leave more room for the chat bar. Switch menu items to menu-sm with smaller icons (via .sidebar-icon class), tighter padding, and smaller text. Add compact mode to SelectTasksMenu with menu-xs sizing and folder icons replacing the repeated "Project" badges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Replace inline task/project selector with Dialog Move the sidebar's task/project selector from an inline <details> dropdown to a Dialog component for better UX. Remove the compact mode from SelectTasksMenu since it's no longer needed, and clean up dead close_menu() DOM logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Pin settings button and notifications to bottom of sidebar Move ProgressWidget, update notification, and settings button to the bottom of the sidebar. ProgressWidget uses mt-auto to push items down, with the update alert appearing above the settings link. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR review feedback for sidebar changes - Add optional chaining for taskDialog calls to prevent potential null errors - Scope .sidebar-icon CSS selector to .sidebar-menu to avoid global style leaks - Add descriptive alt text to project folder icon for accessibility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Better sidebar selector * Redesign task/project selector with two-column layout Rewrite select_tasks_menu.svelte to use a side-by-side project/task layout with responsive pane switching on small screens. Add selected state highlighting, currently-selected banner, project descriptions, race condition handling for async task loading, and wider dialog. Update setup page to match new layout width. Fix folder SVG to use currentColor instead of hardcoded black. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Rename task_selected event to dismiss and close modal on new project/task The event now represents a general dismiss intent, not just task selection. New Project and New Task buttons dispatch dismiss so the modal closes when navigating to creation pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR review feedback: fix reactive task loading and update specs Refactor task loading in select_tasks_menu.svelte to use a single reactive block instead of separate subscription and reactive statement, fixing redundant load_tasks calls. Update spec documents to reflect the task_selected -> dismiss event rename. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * design suggestions * Update ml_model_list.py (#1236) --------- Co-authored-by: scosman <scosman@users.noreply.github.com> Co-authored-by: Leonard Q. Marcq <marcqleonard@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Sam Fierro <13154106+sfierro@users.noreply.github.com> Co-authored-by: aiyakitori <16633065+chiang-daniel@users.noreply.github.com> Co-authored-by: Leonard Q. Marcq <leonard@getkiln.ai> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c46041a commit 29dd632

378 files changed

Lines changed: 14813 additions & 18114 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/api_code_review.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# FastAPI / OpenAPI Standards
2+
3+
Our OpenAPI spec drives our SDK, Scalar docs, and agent tool use (Kiln Chat calls our APIs). Every endpoint must be well-documented and consistently named. Flag violations during code review.
4+
5+
**Required on every endpoint:**
6+
7+
1. **`tags=[...]`** on the route decorator. Every endpoint must belong to a tag group (e.g. `tags=["Projects"]`). Untagged endpoints break Scalar navigation and agent tool discovery. Prefer existing tags, creating new ones only when really needed. All tags should be documented in `tags_metadata` in `server.py`
8+
2. **`summary=`** on the route decorator. A short, unique name for the operation. Summaries must be unambiguous — if two endpoints could share the same summary (e.g. "Edit Tags"), qualify them ("Edit Run Tags", "Edit Document Tags").
9+
3. **Docstring** on the handler function (optional if behavior is completely obvious from the path, method, and summary). When provided, docstrings should be terse — one sentence or a fragment. Never pad with filler like "This endpoint allows you to...". Longer descriptions (2–3 sentences) are warranted only when distinguishing easily confused endpoints, documenting non-obvious side effects, or noting prerequisites. Exclude if the `summary` string already covers the same level of detail.
10+
4. **`Path(description=...)`** on every path parameter, using `Annotated[str, Path(description="...")]` syntax. Recurring ID parameters must use consistent standard descriptions (e.g. `"The unique identifier of the project."`, `"The unique identifier of the task within the project."`).
11+
5. **`Query(description=...)`** on every query parameter.
12+
6. **`Field(description=...)`** on Pydantic model properties that aren't completely self-evident from name + type.
13+
7. **Class docstring** on Pydantic models used as API request/response bodies. These become the schema description in the OpenAPI spec, which agents and SDK users see when inspecting request/response types. Optional but suggested if non-obvious from name.
14+
15+
**Correct HTTP methods:**
16+
17+
- **GET** must be idempotent and side-effect-free. If an endpoint creates, modifies, or deletes data, it must not be GET. We previously had GET endpoints that established connections and ran evaluations — this is wrong and confuses both agents and humans.
18+
- **POST** for creation and actions that trigger execution.
19+
- **PATCH** for partial updates.
20+
- **DELETE** for deletion.
21+
- The only exception is SSE streaming endpoints, which must use GET due to browser `EventSource` constraints. These must have descriptions explicitly noting the mutation and the SSE reason.
22+
23+
**Naming and path conventions:**
24+
25+
- **Always use plural nouns** in path segments: `/tasks/{task_id}`, never `/task/{task_id}`. Same for `/projects`, `/specs`, `/evals`, `/runs`, `/prompts`, `/documents`, `/skills`, `/run_configs`, etc. We had inconsistencies where GET used plural but POST/PATCH/DELETE used singular — this is confusing and must be caught.
26+
- **Paths should be descriptive and intuitive.** Paths should follow REST conventions and be clear (as possible) without docstrings. Path and descriptions should distinguishing similar sounding endpoints. If a path could reasonably be improved, suggest a rename.
27+
- **Consistent path structure** for related resources. All operations on the same resource type should share a common path prefix (e.g. all run config operations under `/run_configs`, not split across `/task_run_config`, `/mcp_run_config`, `/run_config`). Important to not use similar but different prefixes, as this commonly trips up agents.
28+
- **No trailing slashes** on paths. Use `/run_configs` not `/run_configs/`. Trailing slashes cause inconsistency between endpoints and can break client routing.
29+
30+
**Example of a well-documented endpoint:**
31+
32+
```python
33+
@app.delete(
34+
"/api/projects/{project_id}",
35+
summary="Delete Project",
36+
tags=["Projects"],
37+
)
38+
async def delete_project(
39+
project_id: Annotated[
40+
str, Path(description="The unique identifier of the project.")
41+
],
42+
) -> dict:
43+
"""Removes the project from Kiln but does not delete the files from disk."""
44+
```
45+
46+
**What to flag in code review:**
47+
48+
- Missing `tags=` on any route decorator
49+
- Missing `summary=` on any route decorator
50+
- Missing `Path(description=...)` or `Query(description=...)` on any parameter
51+
- GET endpoints that perform mutations (unless SSE with documented justification)
52+
- Singular nouns in path segments where plural is standard
53+
- Ambiguous or duplicate summaries across endpoints
54+
- Trailing slashes on paths
55+
- Inconsistent path naming for the same resource type
56+
- Wordy or filler-padded docstrings ("This endpoint allows you to...")
57+
- Docstrings containing code artifacts, raw `Args:` blocks, or formatting that doesn't read as clean prose in OpenAPI
58+
- Pydantic models used in API request/response types (nested included) missing a class docstring, if the class name alone isn't obvious
59+
- Custom string types with validator-based constraints that don't surface in the OpenAPI schema. Use `StringConstraints` in the `Annotated` type definition so `minLength`/`maxLength` appear automatically (see `FilenameString`, `SkillNameString` for examples). Don't duplicate constraints in individual `Field()` calls.

.agents/code_review_guidelines.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- Editing globals: rarely a good idea. When done it should be thoughtful and clear: singletons clearly designed to be singletons and labeled as such. Never set globals on external libs (structlog) unless this project is an “application” (server always run at top level) and not a library (potentially called from many apps).
1414

1515
### Python specific guide
16-
1716
- Code should be "Pythonic"
1817
- We use `asyncio` where ever possible. Avoid threads unless there's a good reason we can't use async.
1918
- Python json.dumps should always set `ensure_ascii=False`
@@ -25,3 +24,16 @@ The SDK in `/libs/core` is a SDK/library we expose to third parties. We code rev
2524
- Changing existing APIs that break current users should be avoided. Call out breaking API changes, and confirm with user that we're okay with this break.
2625
- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd party docs automatically. The doc strings should be written for 3rd party devs learning the SDK.
2726
- Performance: the base_adapter and litellm_adapter are performance critical. They are the core run-loop of our agent system. We should avoid anything that would slow them down (file reads should be done once and passed in, etc). It's critical to avoid blocking IO - a process may be executing hundreds of these in parallel.
27+
28+
### FastAPI / OpenAPI Standards
29+
30+
If the change impacts API endpoints, read `.agents/api_code_review.md` for instructions on how to code review API endpoints.
31+
32+
Changes impacting APIs include:
33+
- adding/removing/modifying a FastAPI endpoint `@app.get`, `@app.delete`, etc
34+
- adding/removing/modifing a pydantic model which is used in an API endpoint, as a input/return value (including nested models)
35+
36+
### Project specific guide
37+
38+
- **`ModelName` enum and user input:** Do not use the `ModelName` enum for validation or typing of user-provided model identifiers (for example in a Pydantic request body that validates an API payload). Kiln loads additional models over the air; those models can use names that are not members of the locally shipped `ModelName` enum. If request validation is tied to the enum, a model that is valid according to the merged model list will fail validation. Appropriate uses of `ModelName` include aliasing a constant chosen at build time (for example default config that references a known shipped model) and entries inside the `ml_model_list` provider definitions.
39+

.coderabbit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reviews:
2+
path_filters:
3+
- "!app/desktop/studio_server/api_client/kiln_ai_server_client/**"

.config/wt.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
deps = "uv sync && cd app/web_ui && npm install"
33
claude = "utils/setup_claude.sh"
44

5+
[post-start]
6+
copy = "wt step copy-ignored"
7+
58
[pre-remove]
69
session = "zellij delete-session {{ branch | sanitize }} 2>/dev/null || true"

.config/wt/start.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,28 @@ SESSION_NAME="${BRANCH//\//-}"
1616
hash_port() {
1717
printf '%s' "$1" | cksum | awk '{print ($1 % 10000) + 10000}'
1818
}
19-
PORT=$(hash_port "$BRANCH")
19+
20+
port_free() {
21+
! lsof -iTCP:"$1" -sTCP:LISTEN -t >/dev/null 2>&1
22+
}
23+
24+
BASE_PORT=$(hash_port "$BRANCH")
25+
PORT=$BASE_PORT
26+
while ! port_free "$PORT" || ! port_free "$((PORT + 1))"; do
27+
PORT=$((PORT + 1))
28+
if [ "$PORT" -ge 20000 ]; then
29+
PORT=10000
30+
fi
31+
if [ "$PORT" -eq "$BASE_PORT" ]; then
32+
echo "ERROR: no free port pair found in range 10000-19999" >&2
33+
exit 1
34+
fi
35+
done
2036

2137
export KILN_PORT="$PORT"
2238
export KILN_FRONTEND_PORT="$((PORT + 1))"
2339
export VITE_API_PORT="$PORT"
40+
export VITE_BRANCH_NAME="$BRANCH"
2441

2542
export KILN_WEB_URL="http://localhost:$KILN_FRONTEND_PORT"
2643

.cursor/skills/specs/SKILL.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

.cursor/skills/specs/references/cmd_code_review.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)