Skip to content

fix(filebrowser): handle dotless filenames in extension parsing - #804

Closed
CodeLine9 wants to merge 1 commit into
amd:mainfrom
CodeLine9:clawoss/fix/filebrowser-extension-dotless
Closed

CodeLine9 wants to merge 1 commit into
amd:mainfrom
CodeLine9:clawoss/fix/filebrowser-extension-dotless

Conversation

@CodeLine9

Copy link
Copy Markdown
Contributor

Bug

FileBrowser.tsx builds an extension string from filename.split('.').pop(), which returns the entire filename when there's no dot. A file named README produces extension .readme instead of being recognized as having no extension.

Fix

Use lastIndexOf('.') to check for a dot before extracting the extension. Dotless filenames now get an empty string, skipping the unsupported-type error path.

Affected locations:

  • handleIndexSelected (line ~284)
  • handleAskAgent (line ~340)

Closes #793

@CodeLine9

Copy link
Copy Markdown
Contributor Author

Closing — won't have bandwidth to address feedback on this. Apologies for the noise.

@CodeLine9 CodeLine9 closed this Apr 19, 2026
@kovtcharov

Copy link
Copy Markdown
Contributor

No worries, I may still grab your fixes though :).

@kovtcharov

Copy link
Copy Markdown
Contributor

Quick update — bundled this along with your other 6 closed PRs (#805, #806, #807, #808, #809, #810) into #813 with your authorship preserved on every commit. Thanks again, they were all clean small-diff fixes worth landing. 🙏

pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Apr 24, 2026
## Summary

Bundles 7 small, disjoint bug fixes originally submitted by @CodeLine9
in amd#804–amd#810. He closed them himself citing bandwidth; the underlying
issues (amd#642, amd#787, amd#788, amd#789, amd#791, amd#792, amd#793) are all still open and
the fixes are still valid. Each commit preserves CodeLine9's authorship.

All fixes target different files, so the bundle carries **zero merge
conflicts** and is easy to review as a single unit.

## Fixes (one commit each)

- **fix(lemonade): remove `shell=True` from `Popen(list, …)`** (closes
amd#787) — On POSIX, `sh -c` silently dropped
`serve`/`--log-level`/`--ctx-size`. Highest-impact item in the bundle:
Linux/macOS users were running Lemonade with wrong context size and
missing flags.
- **fix(security): validate port is integer in `kill_process_on_port`**
(closes amd#789) — Casts `port` to `int` before shell interpolation. Closes
a latent shell-injection vector in `src/gaia/util.py`. (Follow-up
candidate: consolidate onto the `psutil`-based impl already used
elsewhere.)
- **fix(document-monitor): transition status to `missing` when file
vanishes** (closes amd#791) — Flips DB status so `/api/documents` stops
reporting a deleted file as `complete` and log spam stops after the
first poll.
- **fix(system): retain `asyncio.create_task` refs to prevent GC**
(closes amd#788) — Adds a module-level `_background_tasks` set for
`/api/system/load-model` and `/api/system/download-model`. Fixes a
latent reliability bug where model downloads (7200s timeout) could be
cancelled mid-stream under GC pressure.
- **fix(sse): add lock to tool confirmation flow** (closes amd#792) —
`threading.Lock` around the reset/set critical sections in
`confirm_tool_execution` / `resolve_tool_confirmation`. Closes a race
where an early approval could be clobbered.
- **fix(filebrowser): handle dotless filenames in extension parsing**
(closes amd#793) — `README` no longer produces extension `.readme` in the
unsupported-file error toast.
- **fix(ui): allow horizontal table scroll on mobile** (closes amd#642) —
`overflow: hidden` → `overflow-y: hidden` on `.msg-body` so the inner
`.md-table-wrap` can scroll horizontally.

## Attribution

All 7 commits carry CodeLine9 <[email protected]> as `Author:`. cc
@CodeLine9 — thank you for the triage and the clean small-diff style;
these are all worth having in main.

## Test plan

- [ ] `python util/lint.py --black` passes on touched Python files
(pre-existing `mcp_bridge.py` failure from amd#803 is unrelated)
- [ ] Launch Lemonade from `gaia` on Linux; confirm `--ctx-size` is
respected (previously silently dropped)
- [ ] `gaia chat --ui`, upload a file, delete it from disk, wait >30s;
confirm `/api/documents` flips to `indexing_status: "missing"`
- [ ] Agent UI webui builds (`cd src/gaia/apps/webui && npm run build`)
- [ ] Mobile viewport: table in chat message scrolls horizontally
- [ ] Smoke: `/api/system/download-model` survives a forced
`gc.collect()` cycle mid-download

---------

Co-authored-by: CodeLine9 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileBrowser: extension parsing produces garbage ext for files without a dot

2 participants