Skip to content

[codex] Harden threads schema parse contract tests#797

Merged
senamakel merged 2 commits intotinyhumansai:mainfrom
jwalin-shah:claude/harden-threads-schemas-1
Apr 23, 2026
Merged

[codex] Harden threads schema parse contract tests#797
senamakel merged 2 commits intotinyhumansai:mainfrom
jwalin-shah:claude/harden-threads-schemas-1

Conversation

@jwalin-shah
Copy link
Copy Markdown
Contributor

Summary

  • add focused tests around the shared parse::<T>(params) helper in threads schemas
  • lock in snake_case top-level request contracts and nested camelCase message contracts
  • cover unknown-field and missing-required-field failures explicitly

Problem

The shared thread-schema param parsing path had weak coverage around field naming contracts and serde failure modes, making regressions easier to miss.

Solution

Add targeted tests in src/openhuman/threads/schemas.rs for valid request parsing, deny-unknown-fields behavior, missing required fields, camelCase rejection on outer requests, nested message camelCase enforcement, and optional field handling.

Submission Checklist

  • Unit tests — targeted cargo test coverage added
  • E2E / integration — N/A; schema parse contract hardening only
  • Doc comments — existing file-level docs remain sufficient
  • Inline comments — added around the nested camelCase contract

Impact

No runtime behavior change intended. Improves confidence in the thread controller request contract and error surfaces.

Related

  • Issue(s): none
  • Follow-up PR(s)/TODOs: none

Add focused unit tests around the shared parse::<T>(params) helper in
src/openhuman/threads/schemas.rs covering:

- snake_case params contract for Upsert / MessagesList / Delete / Update
- deny_unknown_fields rejection for every request type (including
  EmptyRequest) with 'invalid params:' error prefix
- missing-required-field errors surface the offending field name
- camelCase top-level keys (e.g. createdAt, threadId) are rejected
  because request structs do not opt into rename_all
- nested ConversationMessageRecord enforces its own camelCase contract
  (messageType / createdAt) even when the outer request is snake_case
- optional fields (assistant_message, extra_metadata) accept absence
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@jwalin-shah has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 10 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 10 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5b0be97-a244-4ea0-9f16-f937ef01cf7b

📥 Commits

Reviewing files that changed from the base of the PR and between b3b451f and 6e94ff2.

📒 Files selected for processing (1)
  • src/openhuman/threads/schemas.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@jwalin-shah jwalin-shah marked this pull request as ready for review April 22, 2026 17:49
@jwalin-shah jwalin-shah requested a review from a team April 22, 2026 17:49
jwalin-shah pushed a commit to jwalin-shah/openhuman that referenced this pull request Apr 23, 2026
Two implementation plans drafted from the life-capture spec:

- Track 1 (ship pipeline): fix Ubuntu installer smoke, land in-flight PRs
  tinyhumansai#806/tinyhumansai#786/tinyhumansai#788/tinyhumansai#797, wire Tauri auto-updater + signed Mac/Windows builds.
- Life-Capture #1 (foundation): SQLite + sqlite-vec personal_index.db,
  Embedder trait + HostedEmbedder (OpenAI), PII redaction, quoted-thread
  stripping, hybrid retrieval (vector + keyword + recency), controller
  schema + RPC. End-to-end test with synthetic items. No ingestion or UI
  yet — those are subsequent milestone plans.
@senamakel senamakel merged commit 22b7a8b into tinyhumansai:main Apr 23, 2026
7 checks passed
jwalin-shah pushed a commit to jwalin-shah/openhuman that referenced this pull request Apr 23, 2026
Two implementation plans drafted from the life-capture spec:

- Track 1 (ship pipeline): fix Ubuntu installer smoke, land in-flight PRs
  tinyhumansai#806/tinyhumansai#786/tinyhumansai#788/tinyhumansai#797, wire Tauri auto-updater + signed Mac/Windows builds.
- Life-Capture #1 (foundation): SQLite + sqlite-vec personal_index.db,
  Embedder trait + HostedEmbedder (OpenAI), PII redaction, quoted-thread
  stripping, hybrid retrieval (vector + keyword + recency), controller
  schema + RPC. End-to-end test with synthetic items. No ingestion or UI
  yet — those are subsequent milestone plans.
@jwalin-shah jwalin-shah deleted the claude/harden-threads-schemas-1 branch April 23, 2026 19:18
jwalin-shah pushed a commit to jwalin-shah/openhuman that referenced this pull request Apr 23, 2026
Two implementation plans drafted from the life-capture spec:

- Track 1 (ship pipeline): fix Ubuntu installer smoke, land in-flight PRs
  tinyhumansai#806/tinyhumansai#786/tinyhumansai#788/tinyhumansai#797, wire Tauri auto-updater + signed Mac/Windows builds.
- Life-Capture #1 (foundation): SQLite + sqlite-vec personal_index.db,
  Embedder trait + HostedEmbedder (OpenAI), PII redaction, quoted-thread
  stripping, hybrid retrieval (vector + keyword + recency), controller
  schema + RPC. End-to-end test with synthetic items. No ingestion or UI
  yet — those are subsequent milestone plans.
jwalin-shah pushed a commit to jwalin-shah/openhuman that referenced this pull request Apr 23, 2026
Two implementation plans drafted from the life-capture spec:

- Track 1 (ship pipeline): fix Ubuntu installer smoke, land in-flight PRs
  tinyhumansai#806/tinyhumansai#786/tinyhumansai#788/tinyhumansai#797, wire Tauri auto-updater + signed Mac/Windows builds.
- Life-Capture #1 (foundation): SQLite + sqlite-vec personal_index.db,
  Embedder trait + HostedEmbedder (OpenAI), PII redaction, quoted-thread
  stripping, hybrid retrieval (vector + keyword + recency), controller
  schema + RPC. End-to-end test with synthetic items. No ingestion or UI
  yet — those are subsequent milestone plans.
jwalin-shah pushed a commit to jwalin-shah/openhuman that referenced this pull request Apr 25, 2026
Two implementation plans drafted from the life-capture spec:

- Track 1 (ship pipeline): fix Ubuntu installer smoke, land in-flight PRs
  tinyhumansai#806/tinyhumansai#786/tinyhumansai#788/tinyhumansai#797, wire Tauri auto-updater + signed Mac/Windows builds.
- Life-Capture #1 (foundation): SQLite + sqlite-vec personal_index.db,
  Embedder trait + HostedEmbedder (OpenAI), PII redaction, quoted-thread
  stripping, hybrid retrieval (vector + keyword + recency), controller
  schema + RPC. End-to-end test with synthetic items. No ingestion or UI
  yet — those are subsequent milestone plans.
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.

3 participants