{"record":{"id":"2ab123eba947e8eb","repo":"vxcontrol/pentagi","slug":"invalid-string-value-got-null","errorCode":null,"errorMessage":"invalid string value: got null","messagePattern":"invalid string value: got null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/args.go","lineNumber":461,"sourceCode":"// UnmarshalJSON into the 12-character Go string `\"write_file\"` (quotes\n// included), which then matches no known enum value, fails validation, and\n// forces an unnecessary tool-call-fixer round-trip. UnmarshalJSON unwraps\n// that redundant quoting instead of failing outright.\n//\n// FileOp, BrowserAction, SubtaskOperationType, and FlowStatusDetail are type\n// aliases for String (not distinct types), so every field declared with one\n// of those names gets this leniency automatically, with zero changes needed\n// at any existing call site: switches, `==` comparisons, and assignments\n// against their constants all keep working exactly as before, because the\n// alias makes them the exact same type as String, not merely a similar one.\ntype String string\n\nfunc (s *String) UnmarshalJSON(data []byte) error {\n\t// A bare JSON \"null\" unmarshals into an empty string with no error by\n\t// default, which would silently mask a required field being omitted -\n\t// treat it as invalid instead, consistent with Bool/Int64/Strings above.\n\tif trimmed := strings.TrimSpace(string(data)); trimmed == \"null\" {\n\t\treturn fmt.Errorf(\"invalid string value: got null\")\n\t}\n\n\tvar raw string\n\tif err := json.Unmarshal(data, &raw); err != nil {\n\t\treturn err\n\t}\n\t*s = String(unwrapRedundantQuotes(raw))\n\treturn nil\n}\n\nfunc (s String) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(string(s))\n}\n\n// String implements fmt.Stringer, so %s/%v formatting and logrus fields show\n// the unwrapped value, and callers that need a plain string (map keys,\n// strings.* helpers, external struct fields, typed casts) can call it explicitly.\nfunc (s String) String() string {","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/args.go#L443-L479","documentation":"Error \"invalid string value: got null\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/tools/args.go:461 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}