Scenarios
End-to-end scenarios showing how Sophonz AI Agent detects errors and automatically creates issues and code-fix PRs/MRs.
Walk through the main Sophonz AI Agent scenarios — from scheduled automatic monitoring to on-demand investigation requests — with step-by-step flows for each.
Scenario 1 — Scheduled automatic monitoring
Situation. Without any manual intervention, the agent detects new errors on a recurring schedule and automatically completes the full cycle: issue creation, fix PR/MR, regression tests, and code review.
Flow
-
Schedule trigger — The agent starts on a configured cron schedule. It queries only errors that appeared after the last successful run, and skips error groups that have already been handled.
-
Error triage — The Observability Agent selects the one to three most impactful error groups from Sophonz telemetry and restores the top stack frames for each.
-
Code analysis and fix drafting — The Engineering Agent explores the repository, identifies the root-cause file, and creates a fix branch. It commits the full updated content of each changed file and automatically opens an issue and a PR/MR that include the stack trace, root cause, and fix rationale.
-
Regression tests — The Test Engineer Agent commits unit tests to the same PR/MR. If needed, it also adds a test job to the CI pipeline.
-
Integrated code review — The Critic Agent reviews the issue, fix code, tests, and CI changes together, then posts review comments on the PR/MR. It evaluates whether the fix actually resolves the problem, whether there are side effects, and whether regression coverage is adequate.
-
Developer merge approval — The developer reviews the completed PR/MR and decides whether to merge. No auto-merge ever occurs.
NOTE — Duplicate prevention
The agent tracks which error groups it has already handled. If the same error appears in a subsequent run, no duplicate issue or PR/MR is created.
Scenario 2 — On-demand immediate check
Situation. You receive an alert about an unexpected crash spike late at night. You want to start the analysis right now rather than waiting for the next scheduled run.
Flow
-
Manual trigger — Click the "Run now" button in the dashboard. Internally, the same pipeline as the scheduled run executes with
triggerType=manual. -
The rest of the flow is identical to Scenario 1. The pipeline proceeds through Observability → Engineering → Test Engineer → Critic in sequence.
TIP — Impact
Tasks that would otherwise require a developer to navigate multiple tools manually are reduced to a single button click and one merge approval. Initial response time typically drops from several hours to a few minutes.
Scenario 3 — Targeted investigation request
Situation. You want to investigate an error in a specific time window or app type that the scheduled monitor did not capture — for example, an error that appeared only on the checkout screen of a sample e-commerce app during a particular hour.
Example request
Analyze Android crashes in the sample e-commerce app
between 2026-05-20 14:00 and 15:00 KST and draft a code fix.Flow
-
Create a request — In the dashboard, select a project and enter a natural-language description including the time range. The request starts in
runningstatus. -
Error lookup — The Observability Agent uses the time range from the request body verbatim to query errors for that window, then restores the stack trace for the most impactful fingerprint.
-
Fix drafting — The Engineering Agent reads the repository code, identifies the root-cause file, and returns the full updated content of each file that needs to change. No commits are made at this stage.
-
Diff review — The request transitions to
awaiting_review. The developer inspects the proposed diff. -
Approve or request changes — If the developer approves, the PR/MR is created and the request completes. If changes are requested, a new attempt starts and the same flow runs again.
NOTE — Review gate
In a targeted investigation request, a PR/MR is only created after the developer has reviewed the diff. Unlike scheduled monitoring, human sign-off is required before any code is submitted to the repository.
Scenario 4 — Error classification and operational learning
Situation. A network error on the checkout screen of a sample e-commerce app is detected for the first time and classified as P1. The same error type later appears sporadically on other screens.
Flow
-
First detection — When the agent detects the network error for the first time, it analyzes the blast radius and occurrence pattern, then opens a P1 issue with high-severity labels (for example,
critical,network). -
Subsequent occurrences — For later occurrences of the same error group, the agent recognizes the group has already been classified and creates a standard bug issue with adjusted title, tone, and labels.
-
Critic re-evaluation — If the Critic Agent determines that the same error recurs after the fix, or that the impact is larger than initially assessed, it suggests a severity re-evaluation in its review comments.
TIP — Why this matters
Beyond fixing individual bugs, the agent builds familiarity with recurring error patterns. When the same error type appears again, priority is assigned faster and more consistently over time.
Typical daily workflow
With scheduled monitoring active, a developer's daily routine simplifies to:
- Check last night's automatic run results in the dashboard.
- If unhandled error groups remain, click "Run now" to trigger an immediate check.
- If any requests are in
awaiting_review, inspect the diff and approve or request changes. - Review Critic comments on auto-generated PRs/MRs and approve the merge.