Skip to content

fix: nightly hardening - fetch timeout clamping - #15

Open
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260426-fetch-timeout-cap
Open

fix: nightly hardening - fetch timeout clamping#15
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260426-fetch-timeout-cap

Conversation

@mouse-value-add

Copy link
Copy Markdown
Collaborator

Problem\n accepted arbitrarily large values. Extremely large timeouts can lead to unreliable runtime behavior (timer overflow/coercion edge cases) and let untrusted config hold network operations open far longer than intended.\n\n## Approach\n- Added constant ().\n- Hardened timeout resolution to clamp oversized values to this maximum.\n- Kept existing fallback behavior for invalid/non-positive timeout values.\n- Added test coverage to assert clamping behavior for very large timeout inputs.\n\n## Verification\n-

you-md@0.2.0 test
vitest run --run test/parser/loadFromUrl.test.ts

RUN v2.1.9 /Users/mouse/.openclaw/workspace/you.md

✓ test/parser/loadFromUrl.test.ts (5 tests) 8ms

Test Files 1 passed (1)
Tests 5 passed (5)
Start at 01:32:13
Duration 247ms (transform 37ms, setup 0ms, collect 41ms, tests 8ms, environment 0ms, prepare 32ms)\n-

you-md@0.2.0 test
vitest run

RUN v2.1.9 /Users/mouse/.openclaw/workspace/you.md

✓ test/parser/markdown.test.ts (11 tests) 3ms
✓ test/core/validator.test.ts (10 tests) 3ms
✓ test/core/discovery.test.ts (13 tests) 5ms
✓ test/cli/skill.test.ts (8 tests) 10ms
✓ test/cli/wizard.test.ts (12 tests) 2ms
✓ test/cli/check.test.ts (4 tests) 10ms
✓ test/core/parser.test.ts (16 tests) 13ms
✓ test/parser/loadFromUrl.test.ts (5 tests) 12ms
✓ test/core/signals.test.ts (21 tests) 9ms
✓ test/parser/frontmatter.test.ts (7 tests) 3ms
✓ test/core/merger.test.ts (4 tests) 2ms
✓ test/cli/templates.test.ts (6 tests) 4ms
✓ test/cli/skill-status.test.ts (1 test) 21ms
✓ test/core/known-sections.test.ts (4 tests) 4ms
✓ test/parser/timeout.test.ts (3 tests) 4ms
✓ test/parser/yaml.test.ts (12 tests) 5ms
✓ test/mcp/server.test.ts (7 tests) 2ms

Test Files 17 passed (17)
Tests 144 passed (144)
Start at 01:32:13
Duration 629ms (transform 322ms, setup 0ms, collect 802ms, tests 110ms, environment 1ms, prepare 743ms)\n- Result: 17 files, 144 tests passing.\n\n## Risks\n- Some consumers might have intentionally set very large timeouts and will now see a max of 60s.\n- This is a behavior change, but constrained to safer upper-bound enforcement.\n\n## Rollback Plan\n- Revert commit to restore prior timeout behavior.\n- Alternatively, adjust upward in a follow-up if a legitimate use case requires it.

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.

1 participant