Repository navigation
Conversation
…into HTTP responses and task sync
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @Evos09 — this is a genuine hardening improvement, and the pattern (generic client-facing detail plus server-side logger.error(... {type(e).__name__})) matches the convention this codebase already uses elsewhere. I verified statically at the current head that none of the three touched files still reflect raw exception text into HTTPException details or error dicts, and that the remaining detail=f"..." interpolations (e.g. backend/routers/task_integrations.py:356, backend/utils/task_integrations_ops.py:83) only interpolate config values like app_key/name, not exception data. The except HTTPException: raise passthrough is preserved, so 401/404 semantics are unchanged.
Per file:
backend/routers/task_integrations.py— all five handlers (asana workspaces/projects, clickup teams/spaces/lists) sanitized consistently.backend/utils/task_integrations_ops.py—refresh_oauth_tokenandcreate_task_internalsanitized; the addederror_code: "internal_error"gives callers a stable machine-readable signal — good.backend/utils/task_sync.py— bothauto_sync_action_itemandauto_sync_action_items_batchnow return a generic "Auto-sync failed".backend/tests/unit/test_task_integrations_error_sanitization.py— the AST audit test is the strong guard here; the string-assertion tests couple tightly to exact source text (a bit brittle), but acceptable..github/checks-manifest.yaml— new entry follows the existing id/command/triggers/lanes/reason pattern correctly.
Blocking — CI is red for reasons this PR introduces, and the follow-ups are small:
- Formatting:
black --checkflags the new test file (would reformat backend/tests/unit/test_task_integrations_error_sanitization.py). Runningscripts/backend-python-format backend/tests/unit/test_task_integrations_error_sanitization.pyshould fix it. - Hermetic Backend E2E:
testing/e2e/test_task_integrations.py:196(test_todoist_timeout_returns_failure_without_real_network) still asserts the old contract'error': 'deterministic Todoist timeout'. Please update it to the sanitized response (and check whethererror_code: 'internal_error'now surfaces in that endpoint's payload so the expected dict matches exactly). - Backend unit suite (shard 4):
backend/tests/unit/test_task_sync_apple_async_boundary.py:157(test_apple_reminder_sync_preserves_single_and_batch_error_results) asserts'error': 'firestore unavailable'for both the single and batch paths — update both expectations to'Auto-sync failed'.
The Backend Hermetic Merge Gate failure is the e2e failure above aggregated. These existing tests codified the old leaking behavior, so updating them to the sanitized contract is part of this change rather than a workaround. With those three tweaks this should go green — happy to re-review. Leaving for human maintainer review before merge.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
…sanitization and format test suite
|
Thanks for the detailed review @Git-on-my-level! All three requested updates have been implemented and pushed to the branch:
Verified locally that all test suites pass cleanly. |
aryanorastar
left a comment
There was a problem hiding this comment.
origin/main backend/routers/task_integrations.py:468 through :640 return Error fetching … {str(e)}; task_integrations_ops.py:154 and :401 and task_sync.py:52 and :146 return str(e). Tests pin that hole. Required checks are green.
|
Thank you @aryanorastar for the review and approval! |
Resolved at 62806a2: the new test file passes formatting, the Todoist-timeout e2e assertion (testing/e2e/test_task_integrations.py) now expects the sanitized "Failed to create task" payload, and the apple async-boundary unit test now expects "Auto-sync failed" on both single and batch paths. Full CI is green on this head and a maintainer approval is recorded on it. Dismissing the stale request as resolved — thanks @Evos09.
|
Follow-up verification on the current head, confirming the three updates requested in the earlier automated review are all in place:
One minor non-blocking consistency nit for a possible follow-up: a few server-side-only logger.error calls still interpolate raw {e} (e.g. backend/utils/task_integrations_ops.py:209, backend/routers/task_integrations.py:743/750/764). Those never reach HTTP responses, so they're fine here — just noting the newer type(e).name style reads cleaner in logs too. Thanks @Evos09 for the quick turnaround on all three items. Already approved by a human maintainer on this head; 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 |
|
Closing and withdrawing this pull request. Our prior 7 merged contributions totaling $350 (Support Tickets #141289328 / #141291126) remain unpaid by BasedHardware. We are freezing all pending contributions. |
|
Hey @Evos09 👋 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:
Before your next PR, please skim:
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! |
Summary
Remediates sensitive exception leakage across HTTP response and task sync boundaries in
backend/routers/task_integrations.py,backend/utils/task_integrations_ops.py, andbackend/utils/task_sync.py:Task Integration Route Handlers (
/v1/task-integrations/asana/workspaces,/v1/task-integrations/asana/projects/{workspace_gid},/v1/task-integrations/clickup/teams,/v1/task-integrations/clickup/spaces/{team_id},/v1/task-integrations/clickup/lists/{space_id}):f"Error fetching ...: {str(e)}") with generic, standardized error messages ("Error fetching workspaces", etc.) returning HTTP 500.logger.error(f"...: {type(e).__name__}"), avoiding disclosure of raw socket traces, DNS errors, database exceptions, internal file paths, or third-party token details to clients.Task Integration Operations (
utils/task_integrations_ops.py):refresh_oauth_token, replacedf"Error refreshing token: {str(e)}"and rawlogger.error(f'...: {e}')with sanitized exception class logging and generic"Error refreshing token"detail.create_task_internal, replaced raw{"success": False, "error": str(e)}with sanitized{"success": False, "error": "Failed to create task", "error_code": "internal_error"}.Task Sync (
utils/task_sync.py):auto_sync_action_itemandauto_sync_action_items_batch, replaced rawstr(e)in returned sync dictionaries with"Auto-sync failed"and updated server-side logging to recordtype(e).__name__.Hermetic Test Suite:
backend/tests/unit/test_task_integrations_error_sanitization.pyverifying that unexpected exceptions, internal traces, database errors, and sensitive server details never leak into HTTP exception details or sync error dictionaries.task-integrations-error-sanitization-testsunder.github/checks-manifest.yaml.Verification
python backend/tests/unit/test_task_integrations_error_sanitization.py: 9/9 passing.git diff: Clean, verified diff.Failure-Class: none
Bounty Payout Destination (EVM - Base Mainnet):
0x7badCdA295Dd7113f374aEA1008e7d5870D48556