feat(subagent): 实验功能设置新增子代理模型配置
- 子代理设置页支持选择次主力模型,仅保存模型引用(不再写补丁字段), 子代理直接继承所选模型的上下文长度与思考模式 - 界面只读展示继承的上下文长度与思考模式,移除补丁编辑项 - 仪表盘统计识别子代理请求(__secondary__):归为「子代理模型(估算)」 并缓存次主力模型定价;自定义网关模型价格按官方同名模型跨 provider 匹配 - bump v0.7.1
This commit is contained in:
1 parent
8b0daabd95
commit
8aed04898c
22 files changed
+16648
-8882
No files matched your search
+21
-2
@@ -5,6 +5,7 @@ import { useConfig } from "./hooks/useConfig";
|
||||
import { useUpdateCheck } from "./hooks/useUpdateCheck";
|
||||
import { ProviderList } from "./components/ProviderList";
|
||||
import { ProviderEdit } from "./components/ProviderEdit";
|
||||
import { SubagentSettingsPage } from "./components/SubagentSettingsPage";
|
||||
import { DashboardPage } from "./components/dashboard/DashboardPage";
|
||||
import { SessionsPage } from "./components/sessions/SessionsPage";
|
||||
import { SettingsModal } from "./components/SettingsModal";
|
||||
@@ -70,7 +71,7 @@ export default function App() {
|
||||
updateConfig,
|
||||
} = useConfig(agent);
|
||||
|
||||
const [view, setView] = useState<"list" | "edit" | "dashboard" | "sessions">("list");
|
||||
const [view, setView] = useState<"list" | "edit" | "subagent" | "dashboard" | "sessions">("list");
|
||||
const [editingProvider, setEditingProvider] = useState<string>("");
|
||||
const [loadTimeout, setLoadTimeout] = useState(false);
|
||||
const [switchMessage, setSwitchMessage] = useState<string | null>(null);
|
||||
@@ -573,7 +574,7 @@ export default function App() {
|
||||
type="button"
|
||||
onClick={() => setView("list")}
|
||||
className={`px-3 py-1 text-sm rounded transition-colors ${
|
||||
view === "list" || view === "edit"
|
||||
view === "list" || view === "edit" || view === "subagent"
|
||||
? "bg-blue-600 text-white"
|
||||
: "text-content-muted hover:text-content-primary"
|
||||
}`}
|
||||
@@ -649,6 +650,15 @@ export default function App() {
|
||||
<DashboardPage />
|
||||
) : view === "sessions" ? (
|
||||
<SessionsPage />
|
||||
) : view === "subagent" ? (
|
||||
<SubagentSettingsPage
|
||||
rawOther={config.raw_other}
|
||||
models={config.models}
|
||||
onChange={(nextRawOther) =>
|
||||
updateConfig((cfg) => ({ ...cfg, raw_other: nextRawOther }))
|
||||
}
|
||||
onBack={() => setView("list")}
|
||||
/>
|
||||
) : view === "list" ? (
|
||||
<ProviderList
|
||||
providers={providers}
|
||||
@@ -813,6 +823,15 @@ export default function App() {
|
||||
>
|
||||
{t("openConfigDir")}
|
||||
</button>
|
||||
{view === "list" && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setView("subagent")}
|
||||
className="px-3 py-1.5 text-sm border border-border rounded hover:bg-hover-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
||||
>
|
||||
{t("subagentSettings")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</footer>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user