{"record":{"id":"a7933a0d86311b45","repo":"chenhg5/cc-connect","slug":"s-invalid-image-batch-window-ms-v-w","errorCode":null,"errorMessage":"%s: invalid image_batch_window_ms %v: %w","messagePattern":"(.+?): invalid image_batch_window_ms (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":422,"sourceCode":"\t\tswitch strings.ToLower(strings.TrimSpace(v)) {\n\t\tcase \"\", \"legacy\":\n\t\t\tprogressStyle = \"legacy\"\n\t\tcase \"compact\", \"card\":\n\t\t\tprogressStyle = strings.ToLower(strings.TrimSpace(v))\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"%s: invalid progress_style %q (want legacy, compact, or card)\", name, v)\n\t\t}\n\t}\n\tuseInteractiveCard := true\n\tif v, ok := opts[\"enable_feishu_card\"].(bool); ok {\n\t\tuseInteractiveCard = v\n\t}\n\n\timageBatchWindow := defaultImageBatchWindow\n\tif raw, ok := opts[\"image_batch_window_ms\"]; ok {\n\t\tms, err := coerceMilliseconds(raw)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s: invalid image_batch_window_ms %v: %w\", name, raw, err)\n\t\t}\n\t\tif ms < 0 {\n\t\t\treturn nil, fmt.Errorf(\"%s: image_batch_window_ms must be >= 0, got %d\", name, ms)\n\t\t}\n\t\timageBatchWindow = time.Duration(ms) * time.Millisecond\n\t}\n\n\t// resource_chunk_size_bytes: byte size for each Range request when chunked-\n\t// downloading Feishu message resources (issue #1741). The larkim SDK does\n\t// not expose Range headers, so for resources above ~2 MiB a plain GET\n\t// returns code=234037. Default 8 MiB; clamped to [1 MiB, 64 MiB].\n\tresourceChunkSize := int64(8 * 1024 * 1024)\n\tif raw, ok := opts[\"resource_chunk_size_bytes\"]; ok {\n\t\tn, err := coerceMilliseconds(raw)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s: invalid resource_chunk_size_bytes %v: %w\", name, raw, err)\n\t\t}\n\t\tif n > 0 {","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L404-L440","documentation":"image_batch_window_ms failed coercion via coerceMilliseconds, meaning the configured value is not a Go numeric type (int/float variants). newPlatform returns this wrapped error naming the raw value. Coexists with the range check that follows (>= 0).","triggerScenarios":"image_batch_window_ms = \"300\" (quoted string), \"300ms\", true, or a table in the feishu platform options.","commonSituations":"Duration-suffix strings copied from other tools' configs; JSON-style quoted numbers in TOML.","solutions":["Use a bare integer: image_batch_window_ms = 300.","Drop units like \"ms\" — the option is always in milliseconds.","See the %T-wrapped coerce error in the chain for the offending type."],"exampleFix":"// before (config.toml)\nimage_batch_window_ms = \"300ms\"\n// after\nimage_batch_window_ms = 300","handlingStrategy":"validation","validationCode":"if raw, ok := opts[\"image_batch_window_ms\"]; ok {\n    switch raw.(type) {\n    case int, int64, float32, float64:\n    default:\n        log.Fatalf(\"image_batch_window_ms must be a number, got %T\", raw)\n    }\n}","typeGuard":"func isNumber(v any) bool { switch v.(type) { case int, int64, float32, float64: return true }; return false }","tryCatchPattern":null,"preventionTips":["Write millisecond integers without quotes or units.","Run a config validation pass before launching the daemon."],"tags":["feishu","config","type-mismatch"],"backgroundTag":"invalid-config-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}