You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(slides): local XML precheck, 99991400 backoff, quota code registration
Lands the four agreed fixes from the 2026-06-08 slides write-path
telemetry analysis:
1. Local XML well-formedness precheck (shortcuts/slides/)
- checkXMLWellFormed: pure syntax validation via stdlib encoding/xml
(same parser family as the backend, false-positive risk ~0);
explicitly rejects <?xml ?> declarations; deliberately allows
multiple top-level elements (legal in block_insert fragments)
- wired into +create --slides (at Validate, so a bad slide no longer
leaves a half-built deck) and +replace-slide --parts
replacement/insertion; errors carry line numbers + escaping
guidance, rejected locally with zero API calls
2. 99991400 rate-limit backoff (retryOnRateLimit)
- the code was registered Retryable:true but no slides loop actually
retried, so one frequency-window hit aborted the whole batch
- up to 2 retries with 1s/2s backoff, announced on stderr,
context-cancellable; wired into the +create slide POST loop and
uploadSlidesMedia (+media-upload and the placeholder upload loop)
- upload switched to UploadDriveMediaAllTyped (retry match requires
typed errors; aligns with the slides typed migration)
3. Quota codes 90003086/87/88 registered (internal/errclass + output)
- cloud-space explorer billing codes passed through as HTTP 200 with
body code!=0; previously fell to SubtypeUnknown
- now CategoryAPI + quota_exceeded, not retryable, with per-code
hints (upgrade plan / free quota / ask admin to enable the module)
4. lark-slides skill tag-whitelist ban (skills/lark-slides/)
- quick-ref: never write tags outside the whitelist, name the six
confirmed-rejected tags (audio/video/timeline/animation/trigger/
header), substitution table, escaping rules
- removed <?xml ?> declarations from all examples (contradicted
backend behavior and the new precheck)
Tested with unit + httpmock integration tests, plus live verification
against the real feishu.cn API: all precheck negatives rejected locally,
no false positives on real create/replace, and 18 concurrent uploads hit
3 real 99991400 responses which all retried and succeeded (18/18).
Hint: "document creation quota of the current plan reached: upgrade the plan or delete documents you no longer need to free quota; retrying will not help"}, // premium plan creation count limit reached
Hint: "document creation quota of the current plan reached: upgrade the plan or delete documents you no longer need to free quota; retrying will not help"}, // A2 plan creation count limit reached
Hint: "the tenant has not purchased or enabled the docs module; ask the tenant admin to enable it before creating documents"}, // unbundle: tenant has not purchased / been granted the docs module
// Docs/slides commercial plan quota codes from the cloud-space explorer
89
+
// service, passed through verbatim by document backends as HTTP 200 with
90
+
// body code≠0 (observed on slides_ai create and drive/v1/import_tasks).
91
+
// Not retryable: these are billing-plan limits.
92
+
LarkErrDocsCreatePremiumQuota=90003086// premium plan document creation count limit reached
93
+
LarkErrDocsCreateA2Quota=90003087// A2 plan document creation count limit reached
94
+
LarkErrDocsModuleUnbundled=90003088// tenant has not purchased / enabled the docs module
87
95
)
88
96
89
97
// legacyHints supplies the per-code actionable hint string for the legacy
@@ -118,6 +126,10 @@ var legacyHints = map[int]string{
118
126
"width/height must be >= 20 px; offsets must be >= 0 and less than the anchor cell's width/height",
119
127
LarkErrDrivePermApplyRateLimit: "permission-apply quota reached: each user may request access on the same document at most 5 times per day; wait or ask the owner directly",
120
128
LarkErrDrivePermApplyNotApplicable: "this document does not accept a permission-apply request (common causes: the document is configured to disallow access requests, the caller already holds the permission, or the target type does not support apply); contact the owner directly",
129
+
130
+
LarkErrDocsCreatePremiumQuota: "document creation quota of the current plan reached: upgrade the plan or delete documents you no longer need to free quota; retrying will not help",
131
+
LarkErrDocsCreateA2Quota: "document creation quota of the current plan reached: upgrade the plan or delete documents you no longer need to free quota; retrying will not help",
132
+
LarkErrDocsModuleUnbundled: "the tenant has not purchased or enabled the docs module; ask the tenant admin to enable it before creating documents",
121
133
}
122
134
123
135
// ClassifyLarkError maps a Lark API error code + message to the legacy
0 commit comments