Skip to content

fix(clickup-app): coerce assignee/due-date/priority inputs (#13922) - #14093

Closed
t3ratech wants to merge 5 commits into
BasedHardware:mainfrom
t3ratech:fix/clickup-coerce-13922
Closed

t3ratech wants to merge 5 commits into
BasedHardware:mainfrom
t3ratech:fix/clickup-coerce-13922

Conversation

@t3ratech

@t3ratech t3ratech commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #13922

Summary

  • _coerce_assignee_ids drops None/"None"/names/negatives/bools — invalid input warns and creates the task unassigned instead of int('sarah') → ValueError abort
  • _coerce_due_date_ms accepts ms timestamps (int/float/digit-string) and ISO; wrong types warn-and-drop instead of silently losing the due date
  • _coerce_priority coerces numeric strings + integral floats with 1–4 bounds
  • Same-class sibling fixes: fuzzy-assignee str(None) token, non-dict transcript segments

New hermetic test_main.py (21 tests) + clickup-coerce-tests manifest check.

Verification

  • 21/21 OK; sibling suites unaffected (5/5 + 2/2)
  • Unpatched: 18 failures + 5 errors incl. the literal issue repro

Review in cubic

Failure-Class: none

@t3ratech

t3ratech commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

/claim #13922 PayPal: [email removed]

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Coercion guards for assignee/due-date/priority prevent task-creation aborts on malformed AI-extracted input; extensive tests, linked issue #13922. Merging.

@Git-on-my-level Git-on-my-level added python positive-signal Automation verified a genuine fix/quality contribution labels Sep 15, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified end-to-end in an isolated, network-disabled container at this head:

  • plugins/omi-clickup-app/test_main.py — 21/21 pass. The suite is genuinely hermetic (stdlib-only stubs for requests, dotenv, fastapi, openai, simple_storage, omi_notifications) and drives the real create_task boundary, the production process_segments handler, and TaskDetector.ai_extract_task_details.
  • Negative control: the same suite run against the pre-PR clickup_client.py/main.py/task_detector.py produces 18 failures + 5 errors, including the literal [Bounty proposal] fix(clickup-app): safely coerce assignee IDs, timestamp due dates, and priority in create_task #13922 repros (assignees=["sarah"] aborting task creation, ms-epoch due dates crashing on 'T' in due_date). So the tests pin the fixed behavior rather than passing vacuously.
  • Sibling suites unaffected: test_clickup_client.py 5/5, test_settings_page.py 2/2.

Code-wise this takes the right failure posture — coerce at the ClickUp API boundary, warn-and-continue instead of aborting task creation:

  • clickup_client.py: _coerce_assignee_ids drops names/"None"/nulls/bools/negatives and dedupes without ever raising; _coerce_priority enforces the 1–4 scale (a previously-forwarded 0/5/99 would 400 or silently misbehave); _coerce_due_date_ms accepts ms int/float/digit-string alongside ISO, preserving the end-of-day convention for date-only strings and the due_date_time semantics, with the pytz fallback intact.
  • task_detector.py: the member_id is not None guard stops the "None" sentinel from being emitted at the source. Tiny non-blocking nit: with break now inside the guard, a fuzzy-matched member lacking an id no longer stops the scan, so a later member with a similar name could also match — harmless since create_task dedupes.
  • main.py: the isinstance(seg, dict) guard in process_segments mirrors the existing logging guard and keeps non-dict content as str(seg) instead of crashing the webhook.
  • .github/checks-manifest.yaml: one small inconsistency — the sibling clickup-app-tests entry also lists .github/checks-manifest.yaml in its triggers while the new clickup-coerce-tests entry only triggers on plugins/omi-clickup-app/**. Worth a follow-up if manifest edits should rerun this lane too.

Nice work — this un-breaks voice-driven task creation for exactly the junk the AI extractor can emit. One hygiene note: #13921 (an earlier PR for the same issue) is also still open, so one of the two should be closed out when this lands. This head already carries a maintainer approval; nothing further needed from my side.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Ivansky1

Ivansky1 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Hi @kodjima33 @josancamon19 — thanks for the review.

Just to clarify the overlap before either PR is merged: #13921 was opened earlier and addresses the same core #13922 regressions — assignee ID coercion, millisecond due-date handling, and priority validation/coercion.

I also noticed both #13921 and #14093 now have maintainer approval and both reviews mention merging.

Since #14093 adds some additional sibling fixes and broader test coverage, could you please clarify how you’d like to handle the overlap, and which PR should be treated as the primary fix for #13922 and bounty attribution?

Thanks.

@t3ratech
t3ratech force-pushed the fix/clickup-coerce-13922 branch from 983ad2c to 2243d30 Compare September 16, 2026 11:36

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Bug fix: coerces assignee/due-date/priority inputs in clickup-app (closes #13922). Root cause explained, 21 hermetic tests, conflict now resolved. Confidence 4/5.

@Git-on-my-level

Copy link
Copy Markdown
Member

Re-verified at the merged head 5d7a535, since upstream/main was merged in after the approval on 2243d30:

  • The approved fix survives the merge unchanged. plugins/omi-clickup-app/clickup_client.py, task_detector.py, and test_main.py are byte-identical between 2243d30 and the merge head; main.py differs only in upstream log-hygiene lines that came in with upstream/main (traceback-print removal, redacted notification logs), and the isinstance(seg, dict) guard in process_segments is intact.
  • The converge commit also dropped the branch's local OAuth drift in clickup_client.py, so the net client diff vs main is now exactly the three coercion hunks — _coerce_assignee_ids, _coerce_priority, _coerce_due_date_ms plus their warn-and-continue wiring in create_task — with no unrelated surface left.
  • plugins/omi-clickup-app/test_main.py: 21/21 pass at this head in a network-disabled container (stdlib-only stubs, no credentials). The suite drives the real create_task boundary, the production process_segments handler, and ai_extract_task_details, including the literal [Bounty proposal] fix(clickup-app): safely coerce assignee IDs, timestamp due dates, and priority in create_task #13922 repros (assignees=["sarah"], ms-epoch due dates, out-of-range priority).
  • .github/checks-manifest.yaml: the clickup-coerce-tests entry parses cleanly and sits under checks: (not exempt:). The earlier cosmetic nit stands if anyone wants to align its triggers with the sibling clickup-app-tests entry (which also lists the manifest itself) — non-blocking.

Still open for maintainers from the earlier thread: #13921 targets the same #13922 and also carries approval, so one of the two should be closed out for attribution when this lands.


by AI on behalf of David — if you need David's attention urgently, please @Git-on-my-level and escalate with need human response.

@t3ratech t3ratech closed this Sep 17, 2026
@t3ratech t3ratech reopened this Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @t3ratech 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified against #13922 on head 933b628 — the crash class is real and genuinely fixed.

What I ran (hermetic, stdlib-only, no network):

  • plugins/omi-clickup-app/test_main.py — 21/21 pass on this head. The same suite against main's plugin code fails 15 tests, including the literal issue repro (a non-numeric assignee list aborting creation), priority 99 being forwarded unvalidated, and the None-sentinel string from fuzzy member matching. The ProcessSegmentsTests drive the real process_segments → create_task handler path with the HTTP call stubbed, so this covers production code, not just the helpers. (The non-dict-segment test also passes on main — _extract_segment_texts landed there separately — so that test is coverage rather than a change in this PR.)
  • plugins/omi-clickup-app/clickup_client.py — _coerce_assignee_ids, _coerce_priority, and _coerce_due_date_ms behave as documented across nulls, sentinel strings, names, bools, negatives, integral floats, digit strings, and ms timestamps. Three non-blocking nits:
    1. str.isdigit() accepts Unicode digits that int() rejects (e.g. superscript two): _coerce_assignee_ids and _coerce_priority raise ValueError on such tokens despite the never-raises docstrings, and create_task's outer handler converts that into an aborted task — the one case where the old per-token try/except was more forgiving. token.isascii() and token.isdigit() (or a guarded int()) closes it. Related: Arabic-Indic digit strings are accepted as numeric IDs — fine if intended, just worth a conscious call.
    2. Due-date parse failures now log the raw value and full exception message; the prior code logged only the exception type. Since these values originate from transcript extraction, the type-only form keeps raw input out of plugin logs.
    3. task_data status dropped its str() coercion — harmless today (no caller passes status), just noting the behavior change.
  • plugins/omi-clickup-app/task_detector.py — the member-id guard correctly stops the None sentinel at the producer; verified both with and without a member id.
  • .github/checks-manifest.yaml — clickup-coerce-tests is registered and Hygiene is green on the head. Minor: sibling entries also list .github/checks-manifest.yaml in triggers so manifest edits re-run their checks; this one doesn't.

Since the last approval (2243d30), the head folded ISO parsing into _coerce_due_date_ms(due_date, tz) while converging with upstream — I diffed the approved vs current plugin files and the coercion behavior is preserved and covered by the suite on this head. Because that approval predates the restructure, the current head should get one fresh maintainer pass before merge.

Thanks @t3ratech — clear issue triage, tight coercion boundary, and tests that actually discriminate.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@t3ratech

Copy link
Copy Markdown
Contributor Author

Rebased onto current main in 2fce3bb — CONFLICTING cleared. Resolutions: manifest union (upstream's clickup/oauth/off entries + clickup-coerce-tests); main.py keeps upstream's _extract_segment_texts helper (strictly better than the inline guard); task_detector.py keeps the member-id None guard; clickup_client.py keeps the _coerce_* abstraction and upstream's _safe_json. One old commit auto-dropped — its Tuple import is already on main.

python3 plugins/omi-clickup-app/test_main.py → 21/21 on the rebased head.

@aryanorastar

Copy link
Copy Markdown
Collaborator

ClickUp member matching on main can append the string None when a member id is missing. This head guards that. 2fce3bbc33bd also commits conflict markers into .github/checks-manifest.yaml, and Hygiene failed, so this stays open and unapproved.

— Astar, on behalf of @aryanorastar

@t3ratech
t3ratech force-pushed the fix/clickup-coerce-13922 branch from 2fce3bb to c7a7db0 Compare September 22, 2026 13:15

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Coercion fix logic is sound (closes #13922, tests included) but the latest commit ('converge with upstream + reposition manifest check') left literal unresolved git conflict markers (<<<<<<< / ======= / >>>>>>>) in .github/checks-manifest.yaml, which is why Hygiene/Desktop/Windows checks are all failing YAML parse. Approve-only; cannot merge broken manifest, author needs to fix the conflict markers.

…ware#13922)

create_task aborted task creation when optional params arrived wrong-typed:
non-numeric assignee tokens (names, JSON nulls, "None" sentinels) raised
inside int(), millisecond due-date timestamps failed ISO parsing, and
priority was forwarded to ClickUp without 1-4 validation.

- ClickUpClient._coerce_assignee_ids: extracts positive int IDs, filters
  sentinels/names/negatives/booleans, dedupes; all-invalid input logs a
  warning and continues unassigned instead of crashing.
- ClickUpClient._coerce_due_date_ms: accepts numeric ms timestamps
  (int/float/digit string) alongside ISO strings; wrong-typed input is
  dropped with a warning rather than failing the request.
- ClickUpClient._coerce_priority: coerces numeric strings/integral floats
  and enforces the 1-4 boundary; invalid values are dropped with a warning.
- task_detector: fuzzy member match no longer emits the "None" sentinel
  for members without an id.
- process_segments: non-dict transcript segments no longer crash the
  webhook handler (same defect class).

Verified: python3 plugins/omi-clickup-app/test_main.py — 21 tests pass
(18 failures + 5 errors on the unpatched code); sibling suites
test_clickup_client.py and test_settings_page.py still pass; manifest
check clickup-coerce-tests passes via .github/scripts/run_checks.py.

Failure-Class: none
@t3ratech
t3ratech force-pushed the fix/clickup-coerce-13922 branch from c7a7db0 to 08b7153 Compare September 23, 2026 09:47
@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open. Not approving 08b7153568b7. origin/main clickup_client.py:405 already int(user_id) for assignees. Hygiene fail plus unrelated Swift/Windows fails. MERGEABLE/UNSTABLE. Do not approve.

— Astar, on behalf of @aryanorastar

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Bug-fix hardening (702 lines, over the 300-line scoped cap), multiple required CI checks failing (Desktop Swift Build, Native Windows, Hygiene) - approve only per policy.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On 08b7153568b74cdf4176775190f97a9129c82354, .github/checks-manifest.yaml deletes hive-limit-coercion-tests. The hole is still on this head.

…checks (restores 27 entries dropped in rebase)
@t3ratech

Copy link
Copy Markdown
Contributor Author

Fixed — hive-limit-coercion-tests is back, plus the other 26 entries that were dropped during the last manifest conflict resolution. The manifest is now upstream/main verbatim plus this PR's clickup-coerce-tests and plugin-oauth-client-log-safety-tests (301 entries total). Pushed as 5d54b86.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Borderline 4/5 but checks-manifest.yaml diff (+4277/-1453) is disproportionate to the stated fix and reviewDecision is CHANGES_REQUESTED — approve only, flagging for manual look.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing because this change is already on main.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @t3ratech 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty proposal] fix(clickup-app): safely coerce assignee IDs, timestamp due dates, and priority in create_task

5 participants