mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-08-31 00:50:02 +08:00
fix(sandbox): satisfy pre-push lint on the skill install surface
Break long lines and add the missing constructor comment so the maintainer push hook can reach the fork.
This commit is contained in:
@@ -437,7 +437,8 @@ func (s *agentService) initializeSkillsManager(
|
||||
toolRegistry.RegisterTool(tools.NewReadSandboxFileTool(store))
|
||||
logger.Infof(ctx, "Registered list_sandbox_files and read_sandbox_file tools")
|
||||
} else {
|
||||
logger.Infof(ctx, "Sandbox backend does not advertise session filesystem capability; list_sandbox_files/read_sandbox_file not registered")
|
||||
logger.Infof(ctx, "Sandbox backend does not advertise session filesystem capability; "+
|
||||
"list_sandbox_files/read_sandbox_file not registered")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +473,7 @@ func registerSandboxShellTool(
|
||||
toolRegistry.RegisterTool(tools.NewInstallShellExecTool(executor))
|
||||
logger.Infof(ctx, "Registered install-mode shell_exec tool")
|
||||
} else {
|
||||
logger.Warnf(ctx, "Sandbox backend does not advertise install-mode shell capability; skill install cannot run")
|
||||
logger.Warnf(ctx, "Sandbox backend does not advertise install-mode shell; skill install cannot run")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -44,7 +44,9 @@ func (*fakeAgentChatModel) Chat(context.Context, []chat.Message, *chat.ChatOptio
|
||||
return &types.ChatResponse{}, nil
|
||||
}
|
||||
|
||||
func (m *fakeAgentChatModel) ChatStream(_ context.Context, _ []chat.Message, opts *chat.ChatOptions) (<-chan types.StreamResponse, error) {
|
||||
func (m *fakeAgentChatModel) ChatStream(
|
||||
_ context.Context, _ []chat.Message, opts *chat.ChatOptions,
|
||||
) (<-chan types.StreamResponse, error) {
|
||||
m.lastToolNames = nil
|
||||
if opts != nil {
|
||||
for _, tool := range opts.Tools {
|
||||
@@ -72,6 +74,7 @@ func (stubSessionFileStore) EnsureSessionDir(context.Context, string, string) er
|
||||
func (stubSessionFileStore) ListSessionFiles(context.Context, string, string) ([]sandbox.RemoteDirEntry, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (stubSessionFileStore) StatSessionFile(context.Context, string, string) (*sandbox.RemoteStatEntry, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -184,7 +184,8 @@ func parseSkillBundleVersion(manifest string) (string, error) {
|
||||
var metadata struct {
|
||||
Version string `yaml:"version"`
|
||||
}
|
||||
if err := yaml.Unmarshal([]byte(strings.Join(lines[frontmatterStart+1:frontmatterEnd], "\n")), &metadata); err != nil {
|
||||
frontmatter := strings.Join(lines[frontmatterStart+1:frontmatterEnd], "\n")
|
||||
if err := yaml.Unmarshal([]byte(frontmatter), &metadata); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return metadata.Version, nil
|
||||
|
||||
@@ -1148,6 +1148,7 @@ func (m *installSandboxManager) SessionFileStore() sandbox.SessionFileStore
|
||||
func (m *installSandboxManager) SessionInstallShellExecutor() sandbox.SessionInstallShellExecutor {
|
||||
return m
|
||||
}
|
||||
|
||||
func (m *installSandboxManager) EnsureSessionDir(context.Context, string, string) error {
|
||||
return nil
|
||||
}
|
||||
@@ -1441,14 +1442,18 @@ func (s *installSessionService) SetSessionOwnerID(context.Context, uint64, strin
|
||||
func (s *installSessionService) GetSessionsByTenant(context.Context) ([]*types.Session, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (s *installSessionService) GetPagedSessionsByTenant(context.Context, *types.Pagination) (*types.PageResult, error) {
|
||||
func (s *installSessionService) GetPagedSessionsByTenant(
|
||||
context.Context, *types.Pagination,
|
||||
) (*types.PageResult, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (s *installSessionService) UpdateSession(context.Context, *types.Session) error {
|
||||
s.fx.sessionCalls = append(s.fx.sessionCalls, "UpdateSession")
|
||||
return nil
|
||||
}
|
||||
func (s *installSessionService) UpdateSessionLastRequestState(context.Context, string, *types.SessionLastRequestState) error {
|
||||
func (s *installSessionService) UpdateSessionLastRequestState(
|
||||
context.Context, string, *types.SessionLastRequestState,
|
||||
) error {
|
||||
return nil
|
||||
}
|
||||
func (s *installSessionService) DeleteSession(context.Context, string) error {
|
||||
@@ -1472,7 +1477,9 @@ func (s *installSessionService) CountSessionsBySource(context.Context, *types.Se
|
||||
func (s *installSessionService) SetSessionPinned(context.Context, string, bool) (int64, error) {
|
||||
return 0, nil
|
||||
}
|
||||
func (s *installSessionService) GenerateTitle(context.Context, *types.Session, []types.Message, string) (string, error) {
|
||||
func (s *installSessionService) GenerateTitle(
|
||||
context.Context, *types.Session, []types.Message, string,
|
||||
) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
func (s *installSessionService) GenerateTitleAsync(context.Context, *types.Session, string, string, *event.EventBus) {
|
||||
|
||||
@@ -50,6 +50,9 @@ type TenantSkillService struct {
|
||||
localLocks *keyedMutex
|
||||
}
|
||||
|
||||
// NewTenantSkillService wires the repositories and runtimes the install and
|
||||
// remove flows share. Redis may be nil; the local lock then serialises one
|
||||
// process only.
|
||||
func NewTenantSkillService(
|
||||
skillsRepo repository.TenantSkillRepository,
|
||||
configsRepo repository.TenantSandboxConfigRepository,
|
||||
|
||||
Reference in New Issue
Block a user