Skip to content

chore: sync dev payload into homolog#699

Merged
namastex888 merged 1 commit into
homologfrom
sync/dev-to-homolog-clean-20260603T0500Z
Jun 3, 2026
Merged

chore: sync dev payload into homolog#699
namastex888 merged 1 commit into
homologfrom
sync/dev-to-homolog-clean-20260603T0500Z

Conversation

@namastex888
Copy link
Copy Markdown
Contributor

Summary

Replacement for #698 (devhomolog) using a clean commit history.

Why this exists:

  • Dev #698 is now mergeable after syncing origin/homolog workflow changes into origin/dev at 351c678f.
  • Dev #698 Quality Gate and Smoke Test passed.
  • But Dev #698's commit-message check fails on an older dev commit body line (31aecaf3) that predates this sync and violates body-max-line-length.
  • Rewriting shared dev history would be riskier than creating this clean sync PR.

What this branch does:

  • Starts from current origin/homolog.
  • Applies the complete current origin/dev tree as one compliant sync commit.
  • Verified HEAD tree matches origin/dev exactly.
  • Excludes unrelated local checkout changes from /home/genie/workspace/omni-khortex-repair.

PR #698 comment review

Reviewed comments/reviews before creating this replacement:

  • CodeRabbit skipped auto-review because base/target is not default branch; no actionable blocker.
  • Gemini Code Assist left a general review note about PII redaction ordering for WhatsApp JIDs vs email regex. This is worth tracking, but it is inherited dev payload and not introduced by this sync mechanism.
  • Codex left P2 feedback: SendMediaSchema OpenAPI schema lacks mimeType even though route handling now accepts it. This is real follow-up API/SDK debt, but not a sync blocker; changing it here would make this replacement no longer be a pure dev→homolog tree sync.

Validation

Local replacement branch:

  • git diff --quiet HEAD origin/dev → PASS, tree matches current dev
  • commit message line-length check → PASS
  • bun install --frozen-lockfile → PASS
  • bun run verify:versions → PASS, 21/21 files match 2.260602.2
  • (cd packages/api && bun run typecheck) → PASS
  • focused API tests → PASS, 81 pass / 0 fail
  • pre-push full monorepo typecheck → PASS, 21/21 turbo tasks successful
  • pre-push full test suite → PASS, 3972 pass / 0 fail / 292 skip

Prior #698 after dev sync:

  • mergeable → MERGEABLE
  • GitHub Quality Gate → PASS
  • GitHub Smoke Test → PASS
  • Commit Messages → FAIL only because of historical commit body line in Dev #698 history

Follow-up after merge

After this PR merges, #698 should be closed as superseded by this clean sync PR. Then continue with the separate canonical trash-reset fix PR to dev, followed by a normal promotion PR to homolog.

Replacement for PR #698 using a clean commit history.

PR #698 includes an older dev commit body that violates commitlint
body-max-line-length. This branch keeps the current origin/dev tree but
places it as one compliant sync commit on top of origin/homolog.

Evidence before creating this branch:
- PR #698 became mergeable after syncing homolog workflow changes into dev.
- Local frozen install passed.
- Local version verification passed.
- Local packages/api typecheck passed.
- Local focused API tests passed: 81 pass, 0 fail.
- Dev pre-push full monorepo typecheck and test passed: 3972 pass, 0 fail.
- GitHub PR #698 Quality Gate and Smoke Test passed.

Scope:
- Contains the current origin/dev tree as of 351c678.
- Excludes unrelated local Gupshup multiline checkout changes.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4397d9f4-05ec-4918-af6f-39967446bf33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/dev-to-homolog-clean-20260603T0500Z

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bumps the project version to 2.260602.2 and introduces several key updates, including OpenTelemetry-based human lifecycle observability tracing with PII redaction in the agent dispatcher, improved reaction target resolution mapping Omni UUIDs to native external IDs, forwarding of WhatsApp voice notes as audio buffers, and an enhanced database search for sparse contacts across platform identities and chat participants. Reviewers suggested expanding the list of sensitive key patterns for redaction, adding a defensive check for undefined targets during reaction resolution, and defensively handling driver-specific query results when executing raw SQL in the person search service.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

const DM_HISTORY_LIMIT = 20;

const LIFECYCLE_PREVIEW_MAX_CHARS = 160;
const LIFECYCLE_SENSITIVE_KEY_PARTS = ['authorization', 'bearer', 'password', 'secret', 'token', 'api_key', 'apikey'];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Expand the list of sensitive key patterns to include common abbreviations like pass, pwd, auth, and credential. This helps prevent accidental exposure of sensitive credentials or tokens in the trace attributes if they are passed under abbreviated keys in the extra metadata object.

Suggested change
const LIFECYCLE_SENSITIVE_KEY_PARTS = ['authorization', 'bearer', 'password', 'secret', 'token', 'api_key', 'apikey'];
const LIFECYCLE_SENSITIVE_KEY_PARTS = ['authorization', 'bearer', 'password', 'pass', 'pwd', 'secret', 'token', 'api_key', 'apikey', 'auth', 'credential'];

Comment on lines +189 to +191
if (target.chatId !== chatId) {
throw reactionTargetNotFound(instanceId, chatId, messageId);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add a defensive check to ensure target is defined before accessing target.chatId. If services.messages.getById returns null or undefined instead of throwing a NotFoundError under certain conditions, accessing target.chatId directly will cause a runtime TypeError.

Suggested change
if (target.chatId !== chatId) {
throw reactionTargetNotFound(instanceId, chatId, messageId);
}
if (!target || target.chatId !== chatId) {
throw reactionTargetNotFound(instanceId, chatId, messageId);
}

LIMIT ${limit}
`);

return result as unknown as Person[];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Depending on the underlying database driver configured with Drizzle (e.g., pg vs postgres), db.execute() may return a driver-specific query result object (where rows are nested under .rows) rather than a raw array of rows. To ensure driver-agnostic safety and prevent potential runtime crashes, defensively check if the result is an array or extract .rows.

    const rows = Array.isArray(result) ? result : (result as any).rows ?? [];
    return rows as Person[];

@namastex888 namastex888 merged commit 8033bed into homolog Jun 3, 2026
10 checks passed
@namastex888 namastex888 deleted the sync/dev-to-homolog-clean-20260603T0500Z branch June 3, 2026 04:57
@namastex888 namastex888 mentioned this pull request Jun 3, 2026
Closed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ad7c2cdea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


function buildSendMediaMetadata(data: z.infer<typeof sendMediaSchema>): Record<string, unknown> {
if (data.type === 'audio' && data.voiceNote === true && data.base64) {
return { audioBuffer: Buffer.from(data.base64, 'base64'), ptt: true };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve base64 so voice notes still convert

For POST /messages/send/media requests with type: "audio", voiceNote: true, and a base64 MP3/WAV/etc., this branch replaces metadata.base64 with audioBuffer. The WhatsApp plugin's processAudioForVoiceNote() only looks at message.content.mediaUrl and message.metadata.base64 before converting to OGG/Opus, so these local uploads now skip conversion and are sent as PTT with the original mime type/buffer, which can make voice notes fail or arrive as invalid/non-voice audio. Please either keep base64 here or teach the converter to consume audioBuffer.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants