Repository navigation
Description
Existing issues
- I searched open issues and this is not already reported.
KiroCrew version
0.11.0
Release channel
Stable
How is it installed?
Desktop app
Platform
Windows
What is broken
An app whose manifest name is 251 or more kebab-case characters passes app_name_error, and then its install fails with an unhandled OSError. POST /api/apps/install answers 500 instead of a named 400, and nothing is installed. The expected result is that the name gate refuses the name with a message, or the install succeeds.
app_name_error is "The single app-name contract" and says "The name is an identity AND a directory component, so the same string has to satisfy both roles" (src/kiro_crew/apps/manifest_names.py:94-98 on main). Its checks (:100-129) cover emptiness, the kebab grammar, reserved names and Windows device stems, with no length bound. The longest component built from the name is the record lock (src/kiro_crew/apps/manager_records.py):
265: return config_dir() / "app-record-locks" / f"{name}.lock"A 251-character name makes that component 256 characters, past the 255-character limit NTFS and common POSIX filesystems apply per component. install_app then raises from the lock create (platform_lock_compat.py:427). The route runs install_app in an executor with no except and maps only result.ok == False to 400 (src/kiro_crew/apps/routes_install.py:452-464). The audit middleware logs the exception and re-raises it (dashboard/server_runtime/middleware_chain.py:199-208, :334-343), so aiohttp answers 500.
| Name length | app_name_error |
install_app |
app_data_dir |
|---|---|---|---|
| 200 | None |
ok | created |
| 250 | None |
ok, app dir path 330 chars | created (335 chars) |
| 256, 3 runs | None |
OSError(22, 'Invalid argument') |
OSError(22) |
The 250-character control installs at 330 to 335-character paths, so the bundled interpreter has no MAX_PATH limit on this host. The failure rests only on the per-component limit.
Why it matters
Every door that admits an app funnels through this function: manifest validation, external self-registration, builtin registration, scaffold and the registry pipeline. So a name the filesystem cannot hold is admitted everywhere and fails only at install, as an internal server error. The user cannot tell from a 500 that the name is the cause. Nothing is written, so the failure is closed. Severity is low. Workaround: shorten the app name.
Reproduction
Harness on Windows with the Desktop app's bundled interpreter and a scratch KIROCREW_HOME (third-party apps allowed). For a source folder whose app.json holds a 256-character kebab name, it calls the installed app_name_error(name), install_app(src) and app_data_dir(name). A fresh home is used for each run. Frequency: 3 of 3 runs at 256 characters failed, and the 200 and 250-character controls installed. The HTTP 500 is traced from source and was not driven through aiohttp.
Portable repro (any OS): assert app_name_error("a" * 251) is not None fails on main. A route test that posts a source whose manifest name is 251 characters gets 500 today.
Relevant log output
Tail of the harness traceback for a 256-character name (scratch home shown as <home>, name shortened):
File "<install-root>\Lib\site-packages\kiro_crew\platform_lock_compat.py", line 427, in open_create_or_existing
return os.open(name, flags | os.O_CREAT | os.O_EXCL, mode, dir_fd=dir_fd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: '<home>\\app-record-locks\\abcdefghi-abcdefghi-...-abcdef.lock'
app_data_dir on the same name raised OSError(22, 'The filename, directory name, or volume label syntax is incorrect'), and the apps folder stayed empty. Through the route, the audit middleware records outcome=error with str(exc)[:200] (middleware_chain.py:204-206).
What would close it
Recommended fix: add a length bound to app_name_error that leaves room for every component derived from the name. Today the longest is <name>.lock, so the bound is 250 characters. Give the refusal its own wire code beside RESERVED_APP_NAME_CODE (:60-64), for example app_name_too_long, so the install route answers 400. Add a test that builds every derived component for a maximum-length name, which pins the bound when a longer derived name is added. Tradeoff: the bound has to track the derived names.
Declared behavior change: a name of 251 or more characters is refused at every admission door with a named error. Names of 250 characters or fewer behave as today.
Rule check: the module notes that tightening a name is a one-way door for apps already published under it (:54-57). A 251-character name cannot install on any common filesystem, so no installed app loses its name. Tests generate names of 1-60 characters (test/test_app_manifest.py:585), and no test pins a longer name.
Alternatives:
- Catch
OSErrorininstall_appand returnAppResult(ok=False). Second: the gate is the single admission point, and this leaves self-registration, scaffold and external-app paths admitting the name. - A tighter product cap such as 64. Second: it is the same one-way door for names between 65 and 250 that install today.
Sibling cases: the callers of app_name_error (manifest.py:470, manager_external.py:116, manager_builtins.py:290, registry_pipeline/install.py:286, registry_pipeline/recovery.py:258, scaffold.py:511, official_catalog.py:662, dashboard/chat_api/slot_create.py:289) all gain the refusal. Must not change: reserved names, device stems and the kebab grammar keep their messages and codes.
Acceptance criteria:
app_name_errorreturns a message for a 251-character kebab name. Fails on main.POST /api/apps/installwith a source whose manifest name is 251 characters answers 400 with the new code and creates nothing. Fails on main (500).- Existing behavior unchanged: a 250-character name installs as today, and reserved names, device stems and grammar errors keep their current messages and codes.
Environment
- OS: Windows 11 25H2, build 26200.9818, 64-bit.
- Platform specificity: none. The 255-character component limit also applies on common POSIX filesystems.
- Probe interpreter: the Desktop app's bundled CPython 3.12.14,
-B, fresh scratchKIROCREW_HOMEper run. - Regression window: the gap is present since
app_name_errorwas split out by refactor(apps): split manifest.py and job_sdk.py into owner modules #21577 (merged). fix(apps): serialize installed.json writers with a per-app record lock #22796 (merged) added the record lock and moved the first failing length from 256 to 251. Unchanged on main through 79a5b87. - Methodology: 2026-11-01 17:03-17:05 UTC, 3 runs at 256 characters plus controls at 200 and 250.
Provenance
Found by reading the app-name gate for limits it does not enforce, then run with a disposable harness on the installed build's real gate and install functions. The route's 500 is traced from source. No live install was attempted.
Related
- Not-a-duplicate positioning:
- Windows: an app named
nulpasses every name gate but its app directory cannot be created #2575 (closed), fixed by fix(apps): reject Windows-reserved device stems as non-portable app names #2590 (merged), is the same class of admitted name the filesystem cannot create, scoped to device stems: "Onlynulreproduces." This report is the length boundary. - fix: handlers call body.get() on a JSON body that may not be an object (500) #25794 (open) is a different 500 at the same route: handlers that call
body.get()on a JSON body that is not an object. This 500 is anOSErrorfrom the install executor. - fix(apps): serialize installed.json writers with a per-app record lock #22796 (merged) added the per-app record lock without bounding the name.
- fix(apps): bind proxy traffic to tracked backend generation #10186 (open), fix(apps): adopt a backend only when the gateway can attribute it #13650 (open) and feat(apps): settings to update installed apps automatically #25512 (open) change
handle_install_appfor proxy secrets, backend adoption and auto-update, and none bounds the name. - Other searches with no relevant hits (searches that found nothing, 2026-11-02) covered issues "app_name_error", "app-record-locks", "handle_install_app" and "app name too long install 500", and PRs "app_name_error".
- Windows: an app named
🤖 AI-assisted report 🤖
Activity
KiroCrewCaptain commentedon Nov 2, 2026
Thanks for the report. This issue has been triaged by Crew Captain and will be assigned to a maintainer, who will follow up here.
mbriones98 commentedon Nov 2, 2026
🤖 Kiro Crew Auto-Pipeline [operator: mbriones98#091ded5d]: Confirmed on main.
app_name_errorinsrc/kiro_crew/apps/manifest_names.pysets no length limit. The longest path component built from the name is the record lockapp-record-locks/<name>.lockinmanager_records.py, so a name of 251 or more characters passes the gate. The install then raisesOSErrorat the lock create, and the install route answers 500. The fix adds a 250-character limit toapp_name_error, so every derived component fits in 255 characters. The refusal gets its own wire code next toRESERVED_APP_NAME_CODE, and the install route answers 400. A test builds every derived component for a maximum-length name, so a longer derived name added later fails the test. No name that installs today is refused: a 250-character name still installs. Reserved names, device stems and grammar errors keep their messages and codes. Labelled for an automated fix; the fix session will claim this issue when it starts.fix(apps): re-export APP_NAME_MAX_LENGTH from the manifest facade
fix(apps): refuse app names longer than 128 characters (kirodotdev#28979