Repository navigation
feat(lark): show last text/card send observation to workspace admins - #9820
Open
jiahao6635 wants to merge 4 commits into
Open
jiahao6635 wants to merge 4 commits into
jiahao6635 wants to merge 4 commits into
Conversation
|
@jiahao6635 is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
9 of 10 tasks
Keep the Lark send observation and workspace pinning schemas. Add the observation copy for the Spanish locale introduced upstream.
This branch has not been deployed
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.
What does this PR do?
When an ordinary Feishu/Lark chat reply fails, the current Patcher only logs the error. Message-reception verification from #9709 cannot explain whether a subsequent reply request was confirmed, refused, or left uncertain.
Expose the last text/card send observation to human workspace owners/admins in Settings → Channels → Feishu. This is one historical API-call observation, not end-to-end delivery, reading, attachment delivery, or current connection health. No saved observation means no recorded evidence, not that the bot has never sent a reply.
The narrow boundary is intentional: observe actual ChatDone text/Markdown-card calls, including each existing fallback call. Empty/skipped replies, failed-task notices, binding messages, typing cleanup and attachment completion do not manufacture or replace evidence.
Related Issue
Follow-up to #9709. Existing related issue/PR searches found no equivalent send-observation UI. No new issue or duplicate PR was created for this change. #9813 and #9804 are unchanged.
Type of Change
Changes Made
Error()strings.last_send_observationconfig field with installation/workspace/channel/status/app/generation fences and completion-order comparison. Preserve concurrent receipt/identity fields andupdated_at. Rebind replaces config and clears the observation; stale generations cannot repopulate it.installed_atprecision with RFC3339Nano so same-second rebinds have distinct cache revisions without exposing the private binding generation.Official error references: send, reply.
How to Test
Verified locally on Linux/amd64, Go 1.26.9, using this checkout's managed, disposable migrated PostgreSQL database and the repository Agent CLI guard.
make sqlccompleted and generated only the new query wrapper.go test -race -count=1 ./internal/integrations/larkpassed. The affected observation tests were rerun after the final context-key rename.TestLarkSendObservationAccessAndWire,TestLarkInstallationSameSecondRebindRevisionandTestLarkInstallationReceiptWireShape, including owner/admin access, ordinary-member rejection, cross-workspace rejection, machine-credential rejection, list non-disclosure, absent evidence and same-second timestamp serialization.go vet ./internal/integrations/lark ./internal/handler ./cmd/serverpassed.pnpm --filter @multica/core exec vitest run api/lark-send-observation.test.ts api/lark-verification.test.ts lark/queries.test.ts.pnpm --filter @multica/views exec vitest run settings/components/lark-tab.test.tsx settings/components/lark-send-observation.test.tsx locales/parity.test.ts.git diff --checkpassed.The database regression covers concurrent inbound-receipt/identity/send-observation writes, nanosecond ordering, wrong workspace/app/generation/channel, revoked installations and rebind clearing. Wiring tests cover actual calls, fallback order, skip paths, independent persistence context, unchanged errors and storage failures. UI tests cover deferred reads, errors versus absent evidence, access affordances and same-second rebind cache isolation. The new serializer regression was run before the precision fix and failed with
same-second rebinds share the send-observation cache revisionon the previous branch head (5ab4eea4a3ce2c6433c60e3963f22579a24ed0a9). After changing only the existinginstalled_attimestamp format to RFC3339Nano, the two bindings retain their distinct microsecond timestamps. Existing response fields and types remain unchanged.Reverse verification used temporary Go overlays, leaving the candidate tree unchanged:
out-of-scope observation accepted, and the rebind assertion fails withold send wrote into a new binding.TestSendObservationFingerprintfails withobservation restarted connection.These are expected mutation failures, not failures of the candidate.
Risks and Verification Limits
Checklist
AI Disclosure
AI tool used: OpenAI Codex
Prompt / approach: Implement the authorized narrow follow-up to Feishu message-reception verification: expose only the latest actual ordinary text/card reply API-call observation, with safe uncertainty semantics and owner/admin access. Inspected current main and existing contributions; preserved send/retry behavior, used atomic generation-fenced config writes, added database/handler/component regressions, ran the checks above and two reverse-verification mutations. Implementation and self-review were automated; no independent human review is claimed.
Publication Status
The feature branch is prepared for manual Draft PR publication. PR creation/edit/comment operations were previously denied with HTTP 403 in this session history; they were not retried or bypassed.