T1c verb-timeout-console: mesh_call waits the timeout its verb's definition names and says it
The console's surface holds the runner's seat definitions; a seat verb's call waits its `timeout`, and a timeout's text names the bound waited, not a fixed 30s. Builds: design 47 H §760, H-A-43 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -927,10 +927,23 @@ func schemaWithoutNode(raw json.RawMessage) map[string]any {
|
||||
}
|
||||
|
||||
// answerText is a discovery verb's answer as MCP content: JSON, indented.
|
||||
// withinOf is how long a call of the target waits: the `timeout` its seat verb's definition names (design 47 H §760), else the
|
||||
// runner's own bound, RequestTimeout.
|
||||
func (s *Surface) withinOf(t target) time.Duration {
|
||||
if t.Seat && s.Definitions != nil {
|
||||
for _, v := range s.Definitions()[t.Tool.Module].Verbs {
|
||||
if v.Name == t.Tool.Name && v.Timeout != nil {
|
||||
return time.Duration(*v.Timeout) * time.Second
|
||||
}
|
||||
}
|
||||
}
|
||||
return bus.RequestTimeout
|
||||
}
|
||||
|
||||
// callFailed is why a call failed, as mesh_call says it: a marked tool or verb that reaches no responder names `withheld`
|
||||
// and the grants part's read (design 46 7-approval-mark §6), and a target known only from an earlier round says so.
|
||||
func (s *Surface) callFailed(t target, err error) string {
|
||||
why := whyItFailed(t.Address, err)
|
||||
why := whyItFailedWithin(t.Address, err, s.withinOf(t))
|
||||
if ok, _ := s.markedTool(t); ok && errors.Is(err, bus.ErrNoResponders) {
|
||||
// A marked subject withheld from a machine whose tool runner does not honour the mark (§6).
|
||||
why += "; it needs the operator's approval, so it may be withheld where the machine's tool runner does not state " +
|
||||
@@ -1147,7 +1160,7 @@ func (s *Surface) discover(ctx context.Context, name string, args map[string]any
|
||||
}
|
||||
var got bus.Answered
|
||||
if t.Seat {
|
||||
got, err = s.conn.Ask(t.Key, callArgs, "")
|
||||
got, err = s.conn.AskWithin(t.Key, callArgs, "", s.withinOf(t))
|
||||
} else {
|
||||
got, err = callTool(s.conn, t.Key, callArgs, nil, x.Listing)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user