From Stack Trace to the Line of Code, Without Opening an IDE
A support engineer escalates a ticket with a stack trace, and the developer who picks it up does the same four things every time: find the file, find the function, check who calls it, look at what changed. TicketResolve now does those four steps, maps the error to the function that threw it, and lists recent changes as suspects rather than causes.

A support engineer escalates a ticket with a stack trace. The developer who picks it up does the same four things every time:
- find the file
- find the function
- check who calls it
- look at what changed there recently
Here's that routine on a Tuesday morning at an online travel company. A customer's checkout fails with:
TypeError: Cannot read properties of undefined (reading 'rate')
at convert (src/checkout/fx.ts:4:22)
at priceInCurrency (src/checkout/price.ts:31:10)
at handler (src/checkout/api.ts:58:5)
The developer, Kenji, opens the repository, finds fx.ts, scrolls to line 4, reads convert(), searches for who calls it (three places), then opens the commit history for the folder. There have been 14 commits this week. He reads them one by one. Forty minutes later, he finds "Refactor FX conversion", merged five hours before the errors started. It removed a fallback for currencies without a rate.
The four steps were the same as last week, and the week before. They took forty minutes because they had to be done by hand.
TicketResolve now does those four steps for them, so the escalation arrives with the answers attached.
First, the basics
- A stack trace lists the functions running when an error happened, innermost first. A stack frame is one line: a function, a file and a line number.
- A repository holds code (GitHub, GitLab or Bitbucket). The default branch is the main line of code.
- The enclosing function is the function that contains a given line.
- References are the places that call a function. Imports are what a file depends on.
- Unmatched frames are in libraries, generated code or other repositories.
- A commit is one saved change; a pull request proposes one or more.
- A suspect is a change that could be responsible; a cause is confirmed by a person.
Why does this matter? Every developer does the same four lookups for every stack trace. Doing them automatically, honestly (suspects, not culprits), turns forty minutes of searching into a minute of reading, and leaves the judgement with the engineer.
The problem, in plain terms
- Every stack trace starts the same manual search.
- Library frames clutter the trail.
- Recent changes are read one by one.
- The first plausible commit is blamed.
Frame by frame
For each stack frame in the investigation's errors, TicketResolve:
- finds the file in your connected GitHub, GitLab or Bitbucket repositories, reading only, with the access you granted
- reads the code around the line at the default branch
- names the enclosing function, in JavaScript/TypeScript, Python, Java, Kotlin, C#, Go, Ruby and PHP. It finds the function by reading the source, never by guessing
- lists where that function is referenced, because those code paths may be affected too
- lists what the file imports
Frames that aren't in your repositories, such as libraries, generated code or another repository, are listed as unmatched rather than silently dropped.
Suspects, not culprits
Recent commits and pull requests that touched a file in the stack trace, and shipped before the error was first seen, are flagged as potentially defective changes. Each one shows its reasons:
- which stack-trace files it touched
- that it shipped before the error was first seen
- whether it mentions terms from the error
The label says what it is: a suspect, not a confirmed cause. Plenty of changes touch a file and break nothing. An engineer still decides.
An explanation engineers can use
The result is a few plain sentences. For example: the error passes through convert() in src/checkout/fx.ts:4. It's referenced from src/checkout/api.ts. One change, "Refactor FX conversion", touched that file five hours before the errors started. No AI writes this summary; it's assembled from the facts above.
If someone wants a patch, Propose a fix is still the way to get one. It makes one AI call, is approved by a person, and becomes a draft pull request that your reviewers merge.
A worked example, start to finish
Here's Kenji's Tuesday, with the stack trace mapped to code. The details are illustrative.
09:00. The support engineer escalates the checkout ticket. The investigation already has the stack trace from the customer's error.
09:01, frame by frame. TicketResolve, reading only, at the default branch:
- Frame 1:
src/checkout/fx.ts:4. Enclosing function:convert(). The code around line 4:return amount * rates[currency].rate;. Referenced fromsrc/checkout/price.tsandsrc/checkout/api.ts(andsrc/invoices/totals.ts). Imports:ratesfromsrc/fx/rates.ts. - Frame 2:
src/checkout/price.ts:31,priceInCurrency(). - Frame 3:
src/checkout/api.ts:58,handler(). - Unmatched: two frames inside a framework library, listed, not dropped.
09:01, suspects. Changes that touched a stack-trace file and shipped before the error was first seen:
- "Refactor FX conversion" (PR #2291): touched
fx.ts; shipped 5 hours before the first error; mentions rate, a term from the error. - "Format prices with locale" (PR #2288): touched
price.ts; shipped 2 days before; doesn't mention error terms.
Both labelled potentially defective changes: suspects, not causes.
09:01, the explanation. The error passes through convert() in src/checkout/fx.ts:4. It's referenced from src/checkout/price.ts, src/checkout/api.ts and src/invoices/totals.ts. One change, "Refactor FX conversion", touched that file five hours before the errors started. Assembled from the facts; no AI.
09:05. Kenji opens PR #2291 first. It removed a fallback for currencies without a rate in rates.ts. He confirms it as the cause. He notices src/invoices/totals.ts also calls convert(), so invoices are likely affected too; he adds that to the investigation.
09:15. He presses Propose a fix: one AI call, restoring the fallback with a test. A colleague approves it; a draft pull request opens; their reviewers merge it.
Forty minutes became five, and the invoice impact was found before anyone reported it.
Five more real-world scenarios
1. A frame in a library
Situation. The innermost frame is inside a third-party package.
How TR handles it. It's listed as unmatched, not silently dropped.
2. A change that broke nothing
Situation. A suspect touched the file but only changed a comment.
How TR handles it. It's still a suspect, with its reasons; the engineer decides.
3. A Go service
Situation. The stack trace is from a Go service.
How TR handles it. Go is supported; the enclosing function is found by reading the source.
4. Another repository
Situation. A frame is in a shared library repository that isn't connected.
How TR handles it. Listed as unmatched.
5. Wanting the fix written
Situation. The engineer wants a patch.
How TR handles it. Propose a fix: one AI call, approved by a person, then a draft pull request.
Why suspects need reasons
A list of "recent changes" is easy to produce and hard to use: in a busy repository, dozens of commits touch the area around any error. Each suspect here comes with three reasons (the stack-trace files it touched, that it shipped before the error was first seen, and whether it mentions terms from the error), so an engineer can tell at a glance which one to open first.
The reasons also show what's not there. A change that touched a stack-trace file but shipped after the error started isn't a suspect at all, because it couldn't have caused it. A change that doesn't mention any term from the error isn't ruled out, but it's usually less likely.
What it reads, and what it doesn't
TicketResolve reads your repositories only, with the access you granted, at the default branch. It doesn't change code, open branches or run anything. It reads the lines around each frame, finds the enclosing function, and looks up references and imports. If you want a change, that's a separate, explicit step: Propose a fix, approved by a person.
Before and after
Before. Forty minutes of opening files, searching for callers and reading 14 commits one by one.
After. Each frame mapped to its function, callers and imports, library frames listed as unmatched, two suspects with their reasons, a plain explanation assembled from facts, and the engineer deciding in five minutes.
How to tell it's working
- Escalations arrive with the function, callers and suspects attached.
- Other affected code paths are found from references.
- Confirmed causes come from engineers, not labels.
Escalating with answers
Support engineers can use the mapping before they escalate. An escalation that says "the error passes through convert() in fx.ts, called from checkout and invoices, with one suspect change five hours earlier" gets picked up faster than one that says "checkout is broken", and the developer starts reading code instead of searching for it.
Who it's for
- Developers who pick up escalations.
- Support engineers who want to escalate with answers.
- Engineering leads triaging incidents.
How it fits with the rest of TicketResolve
Code mapping works on investigations and your connected GitHub, GitLab or Bitbucket repositories. Suspects feed structured fix proposals; Propose a fix comes from Autonomous engineering.
Reading the references list
The references list is often the most useful part. A function called from three places can fail in three places, and the customer who reported the error may only have hit one. In the example, the invoice code path showed up only because it called the same function. Checking each caller before the fix ships often finds customers who are affected but haven't written in yet.
Mistakes to avoid
- Blaming the first suspect without reading it.
- Ignoring unmatched frames. The problem can be in a library.
- Skipping the references list.
Do it in TicketResolve, step by step
Where: the investigation's code view (/dashboard/investigate). You'll need: GitHub, GitLab or Bitbucket connected with read access. Full guides: TR Investigate: from a ticket to a verified fix and TR Autonomous Engineering.
- Connect your repositories with read access.
- Open an investigation that has errors with stack traces.
- Read each frame: file, code around the line, enclosing function, references and imports.
- Check unmatched frames.
- Read the suspects and their reasons.
- Read the plain explanation.
- Confirm the cause yourself, then use Propose a fix if you want a patch.
How to check it worked: each frame shows its function, references and imports, and suspects list their reasons.
Frequently asked questions
Which languages are supported? JavaScript/TypeScript, Python, Java, Kotlin, C#, Go, Ruby and PHP.
How is the function found? By reading the source, never by guessing.
Which code is read? The code around the line at the default branch, reading only.
What about library frames? They're listed as unmatched.
What makes a change a suspect? It touched a stack-trace file and shipped before the error was first seen.
Is a suspect the cause? No. An engineer decides.
Does AI write the explanation? No. It's assembled from the facts.
Can it write a fix? Propose a fix makes one AI call, is approved by a person, and becomes a draft pull request.
Can a change after the error started be a suspect? No. Suspects shipped before the error was first seen.
Does it change our code? No. It reads only, at the default branch.
Can support use this before escalating? Yes. The function, callers and suspects make the escalation clearer.
Explore Topics
Written by
Ghulam Shabbir
Content creator and writer sharing insights and stories.


