fix: cap ARTEX container and tool resource use

This commit is contained in:
ji ruo committed 2026-11-27 15:20:52 +08:00
1 parent 253a8eeac3
commit ea4377ef9a
36 files changed
+1869 -64

No files matched your search

+8 -5
View File
@@ -6,14 +6,17 @@ import (
actool "github.com/Autumn-27/norma/tool"
)
// newAgentSession installs the configurable WebFetch before the SDK builds the
// registry, so every agent role gets one tool and the same proxy/TLS settings.
// newAgentSession installs ARTEX's resource-guarded Bash tool and configurable
// WebFetch before the SDK builds the registry, so every agent role gets the
// same memory/timeout guards and proxy/TLS settings.
func newAgentSession(opts agentcore.Options) *agentcore.Session {
if opts.Tools == nil {
opts.Tools = guardedDefaultTools()
} else if opts.EnableWebFetch {
opts.Tools = append([]actool.CoreTool{}, opts.Tools...)
}
if opts.EnableWebFetch {
opts.EnableWebFetch = false
if opts.Tools == nil {
opts.Tools = actool.DefaultTools()
}
opts.Tools = append(opts.Tools, webfetch.New(actool.WebFetchConfig{
Proxy: opts.WebFetchProxy,
CACert: opts.WebFetchCACert,