{{ message }}
Replace print() error output with structured logging (#68)#77
Merged
Conversation
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/workspace_listing.py`:
- Line 137: The top-level composer load error log currently drops stack context
by calling _logger.error("Failed to load composer rows from global storage: %s",
e); update that call to include the exception traceback by passing exc_info=True
(i.e., _logger.error(..., exc_info=True)) so the stack trace is preserved for
operational debugging while keeping the existing message and exception
interpolation.
In `@services/workspace_tabs.py`:
- Around line 126-131: The warning currently logs the raw cursorDiskKV payload
(row["value"]) which can leak sensitive conversation data and be very large;
update the _logger.warning call(s) that reference row["value"] (the one shown
and the similar block around lines 210-215) to avoid including the raw payload
and instead log stable identifiers and payload size — keep row["key"] (or any
available stable id like bubble id) and add payload length (e.g.,
len(row.get("value", b"")) or length of the string) and/or a checksum/short hash
if you need a stable fingerprint; update the _logger.warning invocations in
workspace_tabs.py that currently format row["value"] accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: aced6938-416d-42b6-b9e3-5c4e0857d0f0
📒 Files selected for processing (17)
api/composers.pyapi/config_api.pyapi/export_api.pyapi/logs.pyapi/pdf.pyapi/search.pyapi/workspaces.pyapp.pyrequirements-lock.txtservices/cli_tabs.pyservices/workspace_listing.pyservices/workspace_resolver.pyservices/workspace_tabs.pytests/test_invalid_workspace_aliases.pytests/test_models_wired_at_read_sites.pytests/test_parse_failure_logging.pytests/test_workspace_tabs_null_bubble.py
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/workspace_tabs.py`:
- Around line 138-145: The JSON decode guard around json.loads in
services/workspace_tabs.py currently only catches json.JSONDecodeError; change
those except clauses (the one around the block that calls _kv_payload_log_meta
and logs via _logger.warning with row["key"] and e) to catch
(json.JSONDecodeError, TypeError, ValueError) so non-text SQLite values or other
decode issues are treated non-fatal; apply the same change to the other
symmetric decode block that logs payload_len/payload_fp (the second handler that
currently only catches JSONDecodeError) so both malformed KV row paths behave
consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 65d3d309-c7f4-4f28-8a15-8bc988cd7bf5
📒 Files selected for processing (2)
services/workspace_listing.pyservices/workspace_tabs.py
7238424 to
e97f28e
Compare
Collaborator
clean6378-max-it
approved these changes
May 25, 2026
wpak-ai
approved these changes
May 26, 2026
33d0478 to
468aacc
Compare
4 tasks
6 tasks
10 tasks
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.

Summary
create_app()(logging.basicConfigat INFO, format includes module and function name for gunicorn/WSGI capture).print()calls inservices/andapi/with module loggers (logging.getLogger(__name__)) usingwarningfor schema drift anderrorwithexc_info=Truefor unexpected failures.traceback.print_exc()from export/PDF handlers in favor of structured traceback viaexc_info=True.test_bubble_schema_drift_is_logged_not_swallowed_silentlyto assert on log output (assertLogs) instead of stdout.Closes #68. Complements #66 (except-pass → logging): services that already logged parse failures are unchanged; this PR finishes Test 10 coverage for paths that still used
print().Files touched:
app.py,services/cli_tabs.py,api/composers.py,api/search.py,api/export_api.py,api/pdf.py,api/config_api.py,tests/test_models_wired_at_read_sites.pyOut of scope:
scripts/export.pyCLI stderr warnings (not underservices//api/per issue).Test plan
python -m pytest -q— 306 passed, 4 skippedprint(calls remain inservices/orapi/DEPLOYMENT.mdSummary by CodeRabbit
Bug Fixes
Chores
Tests