Refactor runtime around world core

This commit is contained in:
lpf
2026-03-15 23:46:06 +08:00
parent ba95aeed35
commit afae9076df
79 changed files with 6526 additions and 6960 deletions

View File

@@ -367,13 +367,13 @@ func (s *Server) handleWebUICron(w http.ResponseWriter, r *http.Request) {
}
}
func (s *Server) handleWebUISubagentsRuntime(w http.ResponseWriter, r *http.Request) {
func (s *Server) handleWebUIRuntimeAdmin(w http.ResponseWriter, r *http.Request) {
if !s.checkAuth(r) {
http.Error(w, "unauthorized", http.StatusUnauthorized)
return
}
if s.onSubagents == nil {
http.Error(w, "subagent runtime handler not configured", http.StatusServiceUnavailable)
if s.onRuntimeAdmin == nil {
http.Error(w, "runtime admin handler not configured", http.StatusServiceUnavailable)
return
}
@@ -411,9 +411,9 @@ func (s *Server) handleWebUISubagentsRuntime(w http.ResponseWriter, r *http.Requ
return
}
result, rpcErr := s.handleSubagentLegacyAction(r.Context(), action, args)
if rpcErr != nil {
http.Error(w, rpcErr.Message, rpcHTTPStatus(rpcErr))
result, err := s.onRuntimeAdmin(r.Context(), action, args)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
writeJSON(w, map[string]interface{}{"ok": true, "result": result})