Repository navigation
feat: record Lark read identity, fall back on real document denials, and keep recovery in deferred captures - #105
Merged
Merged
Conversation
…and keep recovery in deferred captures - A bot that cannot open a document (Lark code 3380004) now falls back to the user in bot mode; the fallback only records bot → user. - Capture reports record the read identity, why it fell back and access changes; status keeps showing a fallback, and same-revision reuse requires the same recorded access. - Deferred acquisition warnings keep the next step, the Lark error and access events; a denied document asks to have it shared instead of signing in again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lark capture in bot mode did not fall back to the user when the bot could not open a document, and when capture could not acquire a document the warning said only "authorization required" without a way forward.
type: api, subtype: unknown, code: 3380004on stderr; the read session only recognizedauthorization/permission_deniedshapes, soCONTEXT_LARK_IDENTITY=botnever fell back on the real error.accessblock (identity,fallback: {from: "bot", cause}for a bot → user fallback only,events) is written tocapture-report.json.context statusshows a fallback warning from the saved report (content only that user can see is now in the snapshot; later bot captures may not read it), so it stays visible after the capture finished. Reports written before this version remain valid.document.acquisition-unavailablenow carriesnext, the redacted Lark error and any access events. A 3380004 body denial asks to have the document shared instead of suggesting to sign in again.fetchFeishuDocSnapshotaccepts anaccessEventscollector so a host policy can record access changes it made during the read (for example adding the bot as a viewer).Compatibility
accessfield; older reports parse unchanged.context run capture:lark:*JSON result: newaccessfield; the fallback diagnostic is now awarning:with the cause (wasinfo:).next,stderr,access_eventsfields.Verification
accessparsing and old-report compatibility; deferred warning keeps Lark error and owner-sharing step.autouser → bot switch is not recorded as a bot → user fallback (regression test).tsc --noEmit,eslinton changed files (0 errors).Checklist
bun run verify:fullpasses.🤖 Generated with Claude Code