Skip to content

feat: folder-as-resource limits & skill validation #1637#1730

Merged
astsiapanay merged 2 commits into
developmentfrom
feat/issue-1637
Jul 17, 2026
Merged

feat: folder-as-resource limits & skill validation #1637#1730
astsiapanay merged 2 commits into
developmentfrom
feat/issue-1637

Conversation

@astsiapanay

Copy link
Copy Markdown
Collaborator

Bounds abuse and enforces skill structural validity with configurable per-resource limits on folder-as-resource complex resources (e.g. skills), and confirms skill validation errors are consistently reported as 400 with a clear message.

Applicable issues

Description of changes

  • Added ComplexResourceService.Settings (maxFiles, maxTotalBytes, maxFileSizeBytes) with sensible defaults (100 files / 16 MiB / 1 MiB), wired via a new complexResource static settings block in AiDial.java and aidial.settings.json (main + test).
  • Enforced the limits on whole-resource PUT (ComplexResourceService.put) before any write or lock is taken, and on single-file PUT (putFile/copyOnWrite) before the version copy, so a rejection leaves no observable version/marker and bounds lock-hold time.
  • Merged the marker's files/fileSizes maps into a single fileMetadata: Map<String, ResourceFileMetadata> field on FolderResourceMarker, so per-file size/etag are tracked together and maxTotalBytes can be checked on a single-file mutation without re-reading existing file content.
  • Confirmed SkillHandler's existing validation (missing SKILL.md, unparseable/incomplete frontmatter) already consistently throws HttpException(BAD_REQUEST, ...) with a clear message — no changes needed there.
  • Documented the new settings in README.md.
  • Added boundary tests for each limit (exact-limit-pass, limit+1-reject) on both whole-resource and single-file PUT, at both the HTTP level (SkillResourceApiTest) and the service level (ComplexResourceServiceTest), verifying rejected writes leave nothing observable.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…er resources #1637

Add configurable maxFiles/maxTotalBytes/maxFileSizeBytes settings for folder-as-resource
complex resources, enforced on whole-resource and single-file PUT so a rejection leaves
nothing observable and bounds lock-hold time. Consolidate per-file size/etag tracking into
a single fileMetadata map on the .dial-resource marker.
@ai-dial-actions

This comment has been minimized.

@ai-dial-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@astsiapanay
astsiapanay merged commit 7788682 into development Jul 17, 2026
9 checks passed
@astsiapanay
astsiapanay deleted the feat/issue-1637 branch July 17, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Folder-as-resource: per-resource limits & skill validation hardening

3 participants