MCPcopy Create free account
hub / github.com/compozy/agh / autonomyToolErrorCodeAndReason

Function autonomyToolErrorCodeAndReason

internal/daemon/native_tools.go:5020–5039  ·  view source on GitHub ↗
(reason taskpkg.AutonomyReasonCode)

Source from the content-addressed store, hash-verified

5018}
5019
5020func autonomyToolErrorCodeAndReason(reason taskpkg.AutonomyReasonCode) (
5021 toolspkg.ErrorCode,
5022 toolspkg.ReasonCode,
5023 error,
5024) {
5025 switch reason {
5026 case taskpkg.AutonomySessionRequired:
5027 return toolspkg.ErrorCodeDenied, toolspkg.ReasonAutonomySessionRequired, toolspkg.ErrToolDenied
5028 case taskpkg.AutonomyForeignRun:
5029 return toolspkg.ErrorCodeDenied, toolspkg.ReasonAutonomyForeignRun, toolspkg.ErrToolDenied
5030 case taskpkg.AutonomyNoActiveLease:
5031 return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyNoActiveLease, toolspkg.ErrToolConflict
5032 case taskpkg.AutonomyLeaseExpired:
5033 return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseExpired, toolspkg.ErrToolConflict
5034 case taskpkg.AutonomyLeaseAlreadyHeld:
5035 return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseAlreadyHeld, toolspkg.ErrToolConflict
5036 default:
5037 return toolspkg.ErrorCodeConflict, toolspkg.ReasonAutonomyLeaseExpired, toolspkg.ErrToolConflict
5038 }
5039}
5040
5041func trimNativeStrings(values []string) []string {
5042 if len(values) == 0 {

Callers 1

nativeAutonomyToolErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected