Merge branch 'sipeed:main' into main

This commit is contained in:
github-actions[bot] 2026-03-24 01:35:02 +00:00 committed by GitHub
commit 0d6630d83c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 61 additions and 2 deletions

View file

@ -1546,7 +1546,7 @@ func applySecurityConfig(cfg *Config, sec *SecurityConfig) error {
// Handle Weixin token
if sec.Channels.Weixin != nil && sec.Channels.Weixin.Token != "" {
cfg.Channels.Discord.token = sec.Channels.Discord.Token
cfg.Channels.Weixin.token = sec.Channels.Weixin.Token
}
// Handle DingTalk client secret

View file

@ -113,7 +113,9 @@ func NewProvider(ctx context.Context, opts ...Option) (*Provider, error) {
// Validate region is set - required for Bedrock request signing
if cfg.Region == "" {
return nil, fmt.Errorf("AWS region not configured: set AWS_REGION, AWS_DEFAULT_REGION, or use WithRegion option")
return nil, fmt.Errorf(
"AWS region not configured: set AWS_REGION, AWS_DEFAULT_REGION, or use WithRegion option",
)
}
// Build client options

View file

@ -155,6 +155,11 @@ export function ConfigPage() {
"Max tool iterations",
{ min: 1 },
)
const toolFeedbackMaxArgsLength = parseIntField(
form.toolFeedbackMaxArgsLength,
"Tool feedback max args length",
{ min: 0 },
)
const summarizeMessageThreshold = parseIntField(
form.summarizeMessageThreshold,
"Summarize message threshold",
@ -203,6 +208,10 @@ export function ConfigPage() {
defaults: {
workspace,
restrict_to_workspace: form.restrictToWorkspace,
tool_feedback: {
enabled: form.toolFeedbackEnabled,
max_args_length: toolFeedbackMaxArgsLength,
},
max_tokens: maxTokens,
context_window: contextWindow,
max_tool_iterations: maxToolIterations,

View file

@ -93,6 +93,33 @@ export function AgentDefaultsSection({
}
/>
<SwitchCardField
label={t("pages.config.tool_feedback_enabled")}
hint={t("pages.config.tool_feedback_enabled_hint")}
layout="setting-row"
checked={form.toolFeedbackEnabled}
onCheckedChange={(checked) =>
onFieldChange("toolFeedbackEnabled", checked)
}
/>
{form.toolFeedbackEnabled && (
<Field
label={t("pages.config.tool_feedback_max_args_length")}
hint={t("pages.config.tool_feedback_max_args_length_hint")}
layout="setting-row"
>
<Input
type="number"
min={0}
value={form.toolFeedbackMaxArgsLength}
onChange={(e) =>
onFieldChange("toolFeedbackMaxArgsLength", e.target.value)
}
/>
</Field>
)}
<Field
label={t("pages.config.max_tokens")}
hint={t("pages.config.max_tokens_hint")}

View file

@ -3,6 +3,8 @@ export type JsonRecord = Record<string, unknown>
export interface CoreConfigForm {
workspace: string
restrictToWorkspace: boolean
toolFeedbackEnabled: boolean
toolFeedbackMaxArgsLength: string
execEnabled: boolean
allowRemote: boolean
enableDenyPatterns: boolean
@ -63,6 +65,8 @@ export const DM_SCOPE_OPTIONS = [
export const EMPTY_FORM: CoreConfigForm = {
workspace: "",
restrictToWorkspace: true,
toolFeedbackEnabled: true,
toolFeedbackMaxArgsLength: "300",
execEnabled: true,
allowRemote: true,
enableDenyPatterns: true,
@ -124,6 +128,7 @@ export function buildFormFromConfig(config: unknown): CoreConfigForm {
const tools = asRecord(root.tools)
const cron = asRecord(tools.cron)
const exec = asRecord(tools.exec)
const toolFeedback = asRecord(defaults.tool_feedback)
return {
workspace: asString(defaults.workspace) || EMPTY_FORM.workspace,
@ -131,6 +136,14 @@ export function buildFormFromConfig(config: unknown): CoreConfigForm {
defaults.restrict_to_workspace === undefined
? EMPTY_FORM.restrictToWorkspace
: asBool(defaults.restrict_to_workspace),
toolFeedbackEnabled:
toolFeedback.enabled === undefined
? EMPTY_FORM.toolFeedbackEnabled
: asBool(toolFeedback.enabled),
toolFeedbackMaxArgsLength: asNumberString(
toolFeedback.max_args_length,
EMPTY_FORM.toolFeedbackMaxArgsLength,
),
execEnabled:
exec.enabled === undefined
? EMPTY_FORM.execEnabled

View file

@ -396,6 +396,10 @@
"workspace_hint": "Base directory for agent file operations.",
"restrict_workspace": "Restrict to Workspace",
"restrict_workspace_hint": "Only allow file operations inside workspace.",
"tool_feedback_enabled": "Tool Feedback",
"tool_feedback_enabled_hint": "Send a short tool-call preview into the current chat before each tool execution.",
"tool_feedback_max_args_length": "Tool Feedback Args Preview Length",
"tool_feedback_max_args_length_hint": "Maximum number of argument characters shown in each tool feedback message. Set to 0 to use the default.",
"exec_enabled": "Allow Commands",
"exec_enabled_hint": "Enable or disable command execution for the app. When disabled, no command requests will run.",
"allow_remote": "Allow Remote Commands",

View file

@ -396,6 +396,10 @@
"workspace_hint": "智能体执行文件读写操作时使用的基础目录。",
"restrict_workspace": "限制工作目录访问",
"restrict_workspace_hint": "仅允许在工作目录内执行文件操作。",
"tool_feedback_enabled": "工具反馈",
"tool_feedback_enabled_hint": "在每次执行工具前,先向当前会话发送一条简短的工具调用预览。",
"tool_feedback_max_args_length": "工具反馈参数预览长度",
"tool_feedback_max_args_length_hint": "每条工具反馈消息中展示的参数字符上限。设为 0 时使用默认值。",
"exec_enabled": "允许命令执行",
"exec_enabled_hint": "控制应用是否允许执行命令。关闭后,所有命令请求都不会执行。",
"allow_remote": "允许远程命令执行",