Files
openobserve/web/src
Sai Nikhil 0d3421adfd fix: send incident context when on incident detail page (#10186)
### **PR Type**
Enhancement


___

### **Description**
- Introduce incidents context provider for SRE agent

- Export and register new provider in index

- Enhance `fetchAiChat` to accept explicit context

- Auto-register and clean incident context in drawer


___

### Diagram Walkthrough


```mermaid
flowchart LR
  A["IncidentDetailDrawer.vue"] 
  B["contextRegistry"] 
  C["createIncidentsContextProvider"] 
  D["useAiChat.fetchAiChat"] 
  E["AI Chat API"]

  A -- "register/unregister incidents" --> B
  B -- "provides incident context" --> C
  C -- "getContext()" --> D
  D -- "send payload" --> E
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>incidentsContextProvider.ts</strong><dd><code>New
incidents context provider</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

web/src/composables/contextProviders/incidentsContextProvider.ts

<ul><li>Add new <code>createIncidentsContextProvider</code> factory<br>
<li> Build SRE agent structured incident context<br> <li> Include
optional fields: dimensions, topology, triggers, RCA</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/10186/files#diff-012246fbc305620dd85432d34ec1fecc32c7bb377474b7a02dc6ed3b6beba78c">+72/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useAiChat.ts</strong><dd><code>Support explicit and
structured context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

web/src/composables/useAiChat.ts

<ul><li>Add <code>explicitContext</code> parameter to
<code>fetchAiChat</code><br> <li> Prioritize explicit, then structured,
then legacy context<br> <li> Rebuild request payload with root
<code>agent_type</code></ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/10186/files#diff-830ee4f21bdbbd0fa5c5c0f43b0a1d0200831e07ccddc91982cf0371c801b046">+27/-12</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>

<summary><strong>IncidentDetailDrawer.vue</strong><dd><code>Auto-register
incidents context in drawer</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

web/src/components/alerts/IncidentDetailDrawer.vue

<ul><li>Remove manual AI chat panel rendering<br> <li>
Auto-register/unregister incidents context via <code>watch</code> and
<code>onUnmounted</code><br> <li> Simplify <code>openSREChat</code> and
remove <code>showAIChat</code> state<br> <li> Update imports to include
context provider</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/10186/files#diff-6973d58a5f49658b07d3533d4db5d32cc6430433b51732481e7497243dadb0b0">+30/-26</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>index.ts</strong><dd><code>Export incidents context
provider</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/composables/contextProviders/index.ts

<ul><li>Export <code>createIncidentsContextProvider</code><br> <li>
Ensure proper newline and ordering</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/10186/files#diff-2f5cd69b9d0b7e1c87c1dbe6ad7cdb7b182014a03594481085561a9d694d2659">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2026-01-26 17:56:34 +05:30
..
2025-09-04 12:38:01 +05:30
2025-12-16 18:36:47 +05:30
2026-01-22 22:11:05 +05:30
2025-11-14 11:55:50 +05:30
2025-11-17 11:36:13 +05:30
2025-12-05 15:43:51 +05:30
2026-01-20 08:27:16 +05:30