Merge branch 'fix/g08' into fix/integrated

# Conflicts:
#	internal/store/migrations.go
This commit is contained in:
kami
2026-08-01 14:38:39 +04:00
39 changed files with 2753 additions and 363 deletions
+9 -2
View File
@@ -60,6 +60,13 @@ var (
ErrNotEnabled = errors.New("tool not on the enabled allowlist")
// ErrNeedsConfirm — the fn is enabled but destructive; needs a confirm turn.
ErrNeedsConfirm = errors.New("destructive tool needs confirmation")
// ErrNotConnected — the row is enabled and well formed, but the thing it
// dispatches to is not wired: the mcp block was dropped from the config
// while enabled MCP rows remained, or the same for the house. Held apart
// from ErrNotEnabled because the act path turns that one into a fresh
// proposal, and drafting a new proposal for a tool that already exists and
// is enabled is a lie about what is wrong.
ErrNotConnected = errors.New("tool is enabled but its backend is not connected")
)
// MCPCaller is the seam for an act that is an MCP tool call rather than a
@@ -134,7 +141,7 @@ func (e *Executor) Exec(ctx context.Context, name string, args []string, confirm
// confirmed. Only the dispatch differs.
if server, remote, ok := mcp.ParseCmd(t.Cmd); ok {
if e.mcp == nil {
return "", ErrNotEnabled
return "", fmt.Errorf("%w: %s is an MCP tool and no mcp block is configured", ErrNotConnected, name)
}
ctx, cancel := context.WithTimeout(ctx, e.timeout)
defer cancel()
@@ -148,7 +155,7 @@ func (e *Executor) Exec(ctx context.Context, name string, args []string, confirm
// row but can never compose a target of its own.
if entityID, service, ok := smarthome.ParseCmd(t.Cmd); ok {
if e.home == nil {
return "", ErrNotEnabled
return "", fmt.Errorf("%w: %s is a house tool and no smarthome block is configured", ErrNotConnected, name)
}
// The confirm turn on a house row is structural, not a column. The
// proposal is written destructive=true, but /tools writes the checkbox