Commit graph

1445 commits

Author SHA1 Message Date
mattn
e8afd31b28
Replace \s+ with [^\S\n]+ to preserve newlines (#299) 2026-02-19 02:02:28 +01:00
Kai Xia(夏恺)
d167b47431
dead code cleanup (#210) 2026-02-19 01:54:13 +01:00
fipso
bb0424e1e2
fix: also use max_completion_tokens for gpt5 era models (#445) 2026-02-19 01:29:34 +01:00
Hua Audio
0d6b22fb3a
Update pkg/utils/message.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-18 23:26:39 +01:00
Huaaudio
98afd39913 remove unicode 2026-02-18 23:18:17 +01:00
Huaaudio
a46fe140a3 update dynamic buffer 2026-02-18 23:14:44 +01:00
Huaaudio
7d8894d842 update message test, change dynamic buffer 2026-02-18 23:14:24 +01:00
Hua Audio
dfc3dffd06
Update pkg/utils/message.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-18 22:43:49 +01:00
Huaaudio
82a2faed9d Privated function 2026-02-18 22:37:45 +01:00
Huaaudio
f38ce0d4ac Update to support extra long code blocks 2026-02-18 22:31:18 +01:00
Hua Audio
4ccee85561
Update pkg/utils/message.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-18 22:16:19 +01:00
Hua Audio
0a9d24e2a2
Merge branch 'sipeed:main' into feat/base-layer-message-split 2026-02-18 22:03:11 +01:00
harshbansal7
b122abd30f fix 2026-02-19 02:28:44 +05:30
Huaaudio
e35a827624 update documents 2026-02-18 21:44:25 +01:00
Hua
e03124dc8a refactor: improve SplitMessage API clarity
- Accept hard upper limit (maxLen) instead of pre-subtracted value
- Caller now passes actual platform limit (e.g., 2000 for Discord)
- Internal buffer of 500 chars is handled within message.go
- Preferred split at maxLen - 500, may extend to maxLen for code blocks
- Never exceeds maxLen, no more mental math for callers
2026-02-18 20:21:51 +00:00
Hua
94a1b8664b refactor: extract message splitting logic to shared utils
- Move FindLast, findLast, and SplitMessage from discord.go to pkg/utils/message.go
- Update discord.go to use utils.SplitMessage()
- Makes splitting logic reusable across other channels
2026-02-18 20:01:53 +00:00
Artem Yadelskyi
d07ac54eef
feat(fmt): Fix fmt 2026-02-18 21:55:55 +02:00
Artem Yadelskyi
5ff4a0f0ef
Merge branch 'main' into fix-formatting 2026-02-18 21:55:29 +02:00
Leandro Barbosa
f7ec89d82d
Merge pull request #411 from harshbansal7/frontmatter_fix
Bug Fix: Fix parsing of SKILL.md file frontmatter - regex
2026-02-18 16:48:47 -03:00
Artem Yadelskyi
9e120f90ea
feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
harshbansal7
287100f303 Comments resolved 2026-02-18 23:13:47 +05:30
yinwm
09a0d19119 fix: add VLLM default API base and implement MaxTokensField support
1. Add VLLM default API base (http://localhost:8000/v1)
   - Previously returned empty string, causing provider creation to fail

2. Implement MaxTokensField configuration
   - Add maxTokensField field to HTTPProvider
   - Add NewHTTPProviderWithMaxTokensField constructor
   - Use configured field name for max_tokens parameter
   - Fallback to model-based detection for backward compatibility

3. Add tests for VLLM, deepseek, ollama default API bases

Example config usage:
{
  "model_name": "glm-4",
  "model": "openai/glm-4",
  "max_tokens_field": "max_completion_tokens"
}

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 01:43:24 +08:00
yinwm
e1583f3b13 refactor: simplify legacy_provider.go from 349 to 49 lines
- Move OAuth helper functions to factory_provider.go
- Add auto-migration in LoadConfig: old providers -> model_list
- Add Workspace field to ModelConfig for CLI-based providers
- Fix OAuth handling to use auth store instead of raw APIKey
- Update tests to use new model_list configuration format

This eliminates the giant switch-case in legacy_provider.go,
achieving the goal of "zero-code provider addition" from the
design document (issue #283).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 01:30:19 +08:00
yinwm
ef7078a356 refactor: reorganize commands and provider architecture
Refactor command handlers into separate files to improve code organization
and maintainability. Each command (agent, auth, cron, gateway, migrate,
onboard, skills, status) now has its own dedicated file.

Restructure provider creation to support new model_list configuration
system that enables zero-code addition of OpenAI-compatible providers.
Move legacy provider logic to separate file for backward compatibility.

Move configuration functions from config.go to separate files
(defaults.go, migration.go) for better organization.
2026-02-19 01:03:34 +08:00
yinwm
a73d8e1a16 feat: add model_list configuration for zero-code provider addition
- Add ModelConfig struct with protocol prefix support (openai/, anthropic/, etc.)
- Implement GetModelConfig with round-robin load balancing
- Add CreateProviderFromConfig factory for protocol-based routing
- Add ModelRegistry for thread-safe endpoint selection
- Maintain full backward compatibility with legacy providers config
- Update README.md and README.zh.md with model_list documentation
- Add migration guide at docs/migration/model-list-migration.md

Supported protocols: openai, anthropic, antigravity, claude-cli, codex-cli,
github-copilot, openrouter, groq, deepseek, cerebras, qwen, zhipu, gemini

Closes #283

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 23:26:00 +08:00
Leandro Barbosa
b1e3b11a5d
Merge pull request #304 from mymmrac/golangci-lint
feat(linters): Added golangci-lint config & CI job
2026-02-18 12:16:58 -03:00
Leandro Barbosa
447c17aeb1 merge: sync upstream/main (PR #213) into feat/multi-agent-routing
Resolve conflicts in pkg/providers/types.go and pkg/agent/loop.go:
- types.go: use protocoltypes aliases from PR #213, keep fallback types
- loop.go: drop old single-agent createToolRegistry (replaced by multi-agent pattern)

Refactor to align with PR #213 patterns:
- instance.go: use NewExecToolWithConfig (accept full config for deny patterns)
- registry.go: pass full config to NewAgentInstance
- loop.go: add Perplexity web search options to registerSharedTools
2026-02-18 11:39:14 -03:00
Artem Yadelskyi
df52d4ad01
feat(linters): Fix linter 2026-02-18 16:26:35 +02:00
Artem Yadelskyi
ef8965048a
Merge branch 'main' into golangci-lint 2026-02-18 16:26:18 +02:00
Artem Yadelskyi
b88f4c9ab5
feat(linters): Fix linter 2026-02-18 16:24:55 +02:00
Artem Yadelskyi
bebf4b0c17
Merge branch 'main' into telegram-bot-commands 2026-02-18 16:21:37 +02:00
Leandro Barbosa
2276bd149e merge: sync upstream/main, wire WebSearch through factory
Merge upstream/main into refactor/provider-protocol-122.
Resolve http_provider.go conflict (keep thin delegate).
Wire OpenAIProviderConfig.WebSearch through providerSelection
and into CodexProvider for codex-auth and codex-cli-token paths.
2026-02-18 11:09:18 -03:00
lxowalle
eda6e37332
feat: Support modifying the command filtering list of the exec tool (#410) 2026-02-18 19:31:15 +08:00
harshbansal7
02b5811b95 add support for \r as well 2026-02-18 16:58:27 +05:30
harshbansal7
994ec72d91 Fix parsing of SKILL.md file frontmatter - regex 2026-02-18 16:55:20 +05:30
Zenix
3390576eea
Feature/websearch OpenAI (#118)
* feature: add web search for codex models

* fix: use more elegant way to solve the issue.
2026-02-18 16:30:30 +08:00
lxowalle
01d694b998
fix: Add comprehensive command injection and system abuse prevention patterns (#401)
* Add comprehensive command injection and system abuse prevention patterns

* fix: Container running as root
2026-02-18 15:33:34 +08:00
Artem Yadelskyi
d49ce32010
Merge branch 'main' into telegram-bot-commands 2026-02-17 20:21:46 +02:00
Luna Reed
acac1972e6 fix(exec): terminate process tree on timeout 2026-02-18 02:01:29 +08:00
yinwm
5d1669ecc4 Merge PR #343: Add Google Antigravity provider and harden tool-call compatibility 2026-02-18 00:13:24 +08:00
Jared Mahotiere
c4cbb5fb35 providers: finalize PR213 review fixes
Phase 1: centralize protocol message/tool/response types in protocoltypes and keep compatibility aliases in providers and protocol packages.

Phase 1: preserve HTTPProvider constructor compatibility and route Anthropic api_base through factory auth/provider constructors with base URL normalization.

Phase 2: expand provider routing/auth tests (deepseek/nvidia/shengsuanyun, codex/claude oauth/codex-cli) and add openai_compat + anthropic coverage for proxy transport, model normalization, numeric option coercion, token-source refresh, and base URL behavior.

Phase 3: apply gofmt and validate with Dockerized tests (go test ./pkg/providers/... ./pkg/migrate and go test ./...).
2026-02-17 11:13:10 -05:00
Leandro Barbosa
4fde0175cf
Merge pull request #227 from mattn/fix-shadowing-running
Fix shadowing field runnnig
2026-02-17 12:58:48 -03:00
yinwm
6913edbb5b Merge PR #368: Add Volcengine (doubao) provider 2026-02-17 23:51:40 +08:00
yinwm
6992012737 Merge PR #333: Add Cerebras provider 2026-02-17 23:41:19 +08:00
yinwm
de4ef9a8be Merge PR #365: Add Qwen provider 2026-02-17 23:37:55 +08:00
zenix.huang
0d16525fab fix: codex tool call 2026-02-17 22:56:31 +08:00
zenix.huang
4cd3f99dd6 fix: remove max_tokens 2026-02-17 22:56:31 +08:00
likeaturtle
6cd419b6e2 Fix the case sensitivity issue when automatically recognizing VolcEngine LLM model names. 2026-02-17 22:49:43 +08:00
mrbeandev
84110aa408 fix(antigravity): preserve thought signature on tool call parts 2026-02-17 20:05:47 +05:30
mrbeandev
99c32714f1 fix(antigravity): sanitize invalid tool-call history ordering 2026-02-17 20:05:41 +05:30