Commit graph

9 commits

Author SHA1 Message Date
mosir
7a89f811e3 style: fix gci import grouping in config, cron, and skills installer 2026-02-26 20:38:11 +08:00
mosir
2d04021e7e merge: resolve conflicts with main 2026-02-26 20:29:24 +08:00
ian
f803b8e5bd feat(skills): add retry for HTTP requests in skill installer (#261)
* feat(skills): add retry mechanism for HTTP requests

Implement a retry mechanism with exponential backoff for HTTP requests in the skill installer. This improves reliability when fetching skills from GitHub by automatically retrying failed requests up to 3 times.

Add comprehensive tests to verify retry behavior under different scenarios including success on different attempts and proper delay between retries.

* fix: improve http request retry logic with status code checks

Add shouldRetry helper function to determine retryable status codes.
Close response body between retry attempts and break early for non-retryable status codes.

* refactor: remove unused BuiltinSkill struct

The struct was not being used anywhere in the codebase, so it's safe to remove it to reduce clutter and improve maintainability.

* refactor(http): move retry logic to utils package

Extract HTTP retry functionality from skills package to utils for better reusability
Add context-aware sleep function and comprehensive tests

* refactor(http): extract retry delay unit to variable

Extract hardcoded retry delay unit to a variable for better testability and flexibility. Update tests to use milliseconds for faster execution while maintaining the same behavior.

* test(http_retry): remove t.Parallel from test cases

* test(http_retry): remove redundant test cases for retry success

The removed test cases for success on second and third attempts were redundant since the retry logic is already covered by other tests. This simplifies the test suite while maintaining coverage.
2026-02-26 20:35:26 +11:00
mosir
d3d089fa6f refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
mosir
8e4686e09d refactor(pkg/utils): add unified atomic file write utility 2026-02-24 13:22:52 +08:00
Artem Yadelskyi
a248f04445 Merge branch 'main' into fix-formatting
# Conflicts:
#	pkg/agent/loop.go
#	pkg/agent/loop_test.go
#	pkg/channels/discord.go
#	pkg/channels/onebot.go
#	pkg/config/config.go
#	pkg/tools/subagent_tool_test.go
2026-02-19 22:04:48 +02:00
Kai Xia(夏恺)
1cd382717b dead code cleanup (#210) 2026-02-19 01:54:13 +01:00
Artem Yadelskyi
9ac60c60f1 feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
lxowalle
e17693b17c * First commit 2026-02-09 19:20:19 +08:00