feat(seer): Nightly user-feedback summary as a second night shift kind#114794
Draft
trevor-e wants to merge 3 commits intotelkins/night-shift-column-deletionfrom
Draft
feat(seer): Nightly user-feedback summary as a second night shift kind#114794trevor-e wants to merge 3 commits intotelkins/night-shift-column-deletionfrom
trevor-e wants to merge 3 commits intotelkins/night-shift-column-deletionfrom
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 990a9ef. Configure here.
… kind Layers a new "feedback_summary" kind on top of the genericized result table. Each org's nightly run now creates one parent row that fans out into one execution branch per enabled kind, with per-kind state tracked under run.extras["kinds"][<kind>]. - New agentic_feedback_summary_strategy (mirrors agentic_triage's shape): SeerAgentClient run with custom feedback list/details tools, pydantic FeedbackSummaryArtifact schema, per-org IDOR scoping, short- circuits when fewer than MIN_FEEDBACKS_TO_SUMMARIZE feedbacks in the last 24h. - cron.py threads `kinds` through schedule → run_for_org → run_execution. Per-kind feature gating: agentic_triage requires organizations:seer-night-shift, feedback_summary requires organizations:seer-night-shift-feedback-summary; both still require the universal gen-ai-features and seat-based-seer-enabled flags. - _update_kind_state uses select_for_update to avoid clobbering between concurrent kind branches sharing the same parent row. - Admin trigger endpoint accepts an optional `kinds` body param. - NightShiftRunResultKind enum gains FEEDBACK_SUMMARY. - Serializer surfaces the per-kind state under a new `kinds` key and picks the most-recent triage error for the legacy errorMessage alias.
1. agentic_triage no longer does run.update(extras=...) after start_run. That call read a stale in-memory snapshot of run.extras and wrote the whole column back, clobbering any concurrent _update_kind_state writes from the feedback_summary branch. The agent_run_id is already persisted via cron's _update_kind_state on the success path. 2. feedback_summary now raises RuntimeError when the agent finishes without producing an artifact, instead of returning the agent_run_id. Cron's existing exception handler then correctly marks the kind as "failed" rather than "succeeded".
Mypy now narrows `k` to NightShiftKind via the membership check against ALL_NIGHT_SHIFT_KINDS, so the type: ignore is no longer needed.
990a9ef to
48a7347
Compare
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.

Stacked on #114828 (which is itself stacked on #114790). Review and land the lower PRs first.
Adds
feedback_summaryas a second night-shift kind on top of the genericized result table.agentic_feedback_summary_strategymirrorsagentic_triage: SeerAgentClient run with custom feedback list/details tools, pydanticFeedbackSummaryArtifact, per-org IDOR scoping, short-circuits below 10 unresolved feedbacks in the last 24h.cron.pythreadskindsthrough schedule → run-for-org → execution. Per-kind feature gates: triage keepsorganizations:seer-night-shift; feedback summary requires the neworganizations:seer-night-shift-feedback-summary. Universalgen-ai-featuresandseat-based-seer-enabledstill apply.extras["kinds"][<kind>]and is updated viaselect_for_updateso concurrent kind branches don't clobber each other.kindsbody param.kindsresponse key for per-kind state.