Repository: UKGovernmentBEIS/inspect_ai
Issue: Inspect view error: "Cannot perform the operation at a path that does not exist"
Root cause: Algorithmic Error

Getting an error with the attached log in Inspect View.

Inspect version [5fc903f](https://github.com/UKGovernmentBEIS/inspect_ai/commit/5fc903f2ec4d69147ba28c71c74b3edd27d1dd9e)

[log.zip](https://github.com/user-attachments/files/17011670/log.zip)

```
Error: Cannot perform the operation at a path that does not exist name: OPERATION_PATH_UNRESOLVABLE index: 0 operation: { "op": "replace", "path": "/browser_state/last_observation/description", "value": "https://www.google.com/search?q=number+of+layers+in+Attention+is+All+You+Need+paper\n\nAccessibility links\n<a id=0 Accessibility help>\n<textarea id=1 number of layers in Attention is All You Need paper>\n<div id=2 Clear>\n<div id=3 Search by voice>\n<div id=4 Search by image>\n<button id=5 Search>\n<div id=6 Settings>\n<a id=7 Google apps>\n<a id=8 Sign in>\nFilters and topicsAll\n<a id=9 Images>\n<a id=10 Videos>\n<a id=11 News>\n<a id=12 Web>\n<a id=13 Books>\n<a id=14 Maps>\n<div id=15 More>\nSearch ResultsFeatured snippet from the web6 identical layers\n<a id=16 Attention Is All You Need - arXiv arXiv https://arxiv.org › html>\n<a id=17 About featured snippets>\n•\n<div id=18 Feedback>\nPeople also ask\n<div id=19 About this result>\n<div id=20 How many citations are there for Attention Is All You Need?>\n<div id=21 Did eight people published a paper Attention Is All You Need in 2017?>\n<div id=22 Which conference is Attention Is All You Need?>\n<div id=23 Who wrote the paper \"Attention is all you need\"?>\n<div id=24 Feedback>\n<a id=25 Attention is All you Need NIPS papers https://papers.neurips.cc › paper › 7181-attention-i...>\nby A Vaswani · Cited by 1330858 parallel attention layers11 pagesRecent posts\n<div id=26 About this result>\n<a id=27 Cristian Leo Medium The Math Behind Transformers Transformers have revolutionized the landscape of machine learning, fundamentally changing how we handle sequential data. . 1 month ago>\n<span id=28 About this result>\n<a id=29 Andrew Lukyanenko Medium Paper Review: Masked Attention is All You Need for Graphs Graph neural networks (GNNs) and message passing algorithms are widely used for learning on graphs but require significant research and... . 1 month ago>\n<span id=30 About this result>\n<a id=31 PRMJ Medium Transformer Model from “Attention is All You Need” that Revolutionized Machine Learning In 2017, a team led by Ashish Vaswani released the paper “Attention is All You Need,” which presented the Transformer model,... . 7 Jul 2024>\n<span id=32 About this result>\n<a id=33 [1706.03762] Attention Is All You Need arXiv https://arxiv.org › cs>\n12 Jun 2017Weaaaaattentionaa\n<a id=34 Attention Is All You Need : A Complete Guide to Transformers Medium · Alejandro Ito Aramendia 8 months ago>\n6 identical stacked layers\n<a id=35 Transformers Hugging Face https://huggingface.co › blog › attention-is-all-you-need>\n2 Jul 2024two\n<a id=36 Paper Implementation — Attention Is All You Need ... Medium · Ujjalkumarmaity 9 months ago>\ntwo sub-layers in each encoder layer\n<a id=37 Transformers in Action: Attention Is All You Need Towards Data Science https://towardsdatascience.com › transformers-in-action-...>\nby S Ghaderi6 in the original paper\n<a id=38 Encoder>\n<a id=39 Scaled dot-product attention>\n<a id=40 Multi-head attention>\n<a id=41 Cross-attention>\n<a id=42 [R] [1706.03762] Attention Is All You Need <-- Sota NMT Reddit · r/MachineLearning 50+ comments · 7 years ago>\n6 \"layers\n<a id=43 [Discussion] (Rant) Most of us just pretend to understand ...>\n2 Dec 2021\n<a id=44 [D] Attention Is All You Need - Encoder-Decoder ... - Reddit>\n19 Jan 2020\n<a id=45 Why do Attention layers work so well? Don't weights in DNNs ...>\n2 Oct 2022\n<a id=46 [D] Whats the intuition behind stacking attention layers? - Reddit>\n10 Jun 2023\n<a id=47 More results from www.reddit.com>\n<a id=48 Attention is all you need to understand - by Jon Evans Substack · Gradient Ascendant 10+ likes · 1 year ago>\nattention layersPeople also search for\n<div id=49 About this result>\n<a id=50 Number of layers in attention is all you need paper explanation>\n<a id=51 Attention is all you need explained>\n<a id=52 Attention is all you need PDF>\n<a id=53 Attention is all you need Google Scholar>\n<a id=54 Attention is all you need research paper>\n<a id=55 Attention is all you need Citation>\n<a id=56 Attention is all you need code>\n<a id=57 Attention is all you need bibtex>\nPage navigation\n<a id=58 2>\n<a id=59 3>\n<a id=60 4>\n<a id=61 5>\n<a id=62 6>\n<a id=63 7>\n<a id=64 8>\n<a id=65 9>\n<a id=66 10>\n<a id=67 Next>\nFooter links " } tree: {}
at OPERATION_PATH_UNRESOLVABLE: Cannot perform the operation at a path that does not exist
name: OPERATION_PATH_UNRESOLVABLE
index: 0
operation: {
  "op": "replace",
  "path": "/browser_state/last_observation/description",
  "value": "https://www.google.com/search?q=number+of+layers+in+Attention+is+All+You+Need+paper\n\nAccessibility links\n<a id=0 Accessibility help>\n<textarea id=1 number of layers in Attention is All You Need paper>\n<div id=2 Clear>\n<div id=3 Search by voice>\n<div id=4 Search by image>\n<button id=5 Search>\n<div id=6 Settings>\n<a id=7 Google apps>\n<a id=8 Sign in>\nFilters and topicsAll\n<a id=9 Images>\n<a id=10 Videos>\n<a id=11 News>\n<a id=12 Web>\n<a id=13 Books>\n<a id=14 Maps>\n<div id=15 More>\nSearch ResultsFeatured snippet from the web6 identical layers\n<a id=16 Attention Is All You Need - arXiv arXiv https://arxiv.org › html>\n<a id=17 About featured snippets>\n•\n<div id=18 Feedback>\nPeople also ask\n<div id=19 About this result>\n<div id=20 How many citations are there for Attention Is All You Need?>\n<div id=21 Did eight people published a paper Attention Is All You Need in 2017?>\n<div id=22 Which conference is Attention Is All You Need?>\n<div id=23 Who wrote the paper \"Attention is all you need\"?>\n<div id=24 Feedback>\n<a id=25 Attention is All you Need NIPS papers https://papers.neurips.cc › paper › 7181-attention-i...>\nby A Vaswani · Cited by 1330858 parallel attention layers11 pagesRecent posts\n<div id=26 About this result>\n<a id=27 Cristian Leo Medium The Math Behind Transformers Transformers have revolutionized the landscape of machine learning, fundamentally changing how we handle sequential data. . 1 month ago>\n<span id=28 About this result>\n<a id=29 Andrew Lukyanenko Medium Paper Review: Masked Attention is All You Need for Graphs Graph neural networks (GNNs) and message passing algorithms are widely used for learning on graphs but require significant research and... . 1 month ago>\n<span id=30 About this result>\n<a id=31 PRMJ Medium Transformer Model from “Attention is All You Need” that Revolutionized Machine Learning In 2017, a team led by Ashish Vaswani released the paper “Attention is All You Need,” which presented the Transformer model,... . 7 Jul 2024>\n<span id=32 About this result>\n<a id=33 [1706.03762] Attention Is All You Need arXiv https://arxiv.org › cs>\n12 Jun 2017Weaaaaattentionaa\n<a id=34 Attention Is All You Need : A Complete Guide to Transformers Medium · Alejandro Ito Aramendia 8 months ago>\n6 identical stacked layers\n<a id=35 Transformers Hugging Face https://huggingface.co › blog › attention-is-all-you-need>\n2 Jul 2024two\n<a id=36 Paper Implementation — Attention Is All You Need ... Medium · Ujjalkumarmaity 9 months ago>\ntwo sub-layers in each encoder layer\n<a id=37 Transformers in Action: Attention Is All You Need Towards Data Science https://towardsdatascience.com › transformers-in-action-...>\nby S Ghaderi6 in the original paper\n<a id=38 Encoder>\n<a id=39 Scaled dot-product attention>\n<a id=40 Multi-head attention>\n<a id=41 Cross-attention>\n<a id=42 [R] [1706.03762] Attention Is All You Need <-- Sota NMT Reddit · r/MachineLearning 50+ comments · 7 years ago>\n6 \"layers\n<a id=43 [Discussion] (Rant) Most of us just pretend to understand ...>\n2 Dec 2021\n<a id=44 [D] Attention Is All You Need - Encoder-Decoder ... - Reddit>\n19 Jan 2020\n<a id=45 Why do Attention layers work so well? Don't weights in DNNs ...>\n2 Oct 2022\n<a id=46 [D] Whats the intuition behind stacking attention layers? - Reddit>\n10 Jun 2023\n<a id=47 More results from www.reddit.com>\n<a id=48 Attention is all you need to understand - by Jon Evans Substack · Gradient Ascendant 10+ likes · 1 year ago>\nattention layersPeople also search for\n<div id=49 About this result>\n<a id=50 Number of layers in attention is all you need paper explanation>\n<a id=51 Attention is all you need explained>\n<a id=52 Attention is all you need PDF>\n<a id=53 Attention is all you need Google Scholar>\n<a id=54 Attention is all you need research paper>\n<a id=55 Attention is all you need Citation>\n<a id=56 Attention is all you need code>\n<a id=57 Attention is all you need bibtex>\nPage navigation\n<a id=58 2>\n<a id=59 3>\n<a id=60 4>\n<a id=61 5>\n<a id=62 6>\n<a id=63 7>\n<a id=64 8>\n<a id=65 9>\n<a id=66 10>\n<a id=67 Next>\nFooter links "
}
tree: {}
    at new PatchError2 (http://localhost:7575/assets/index.js:17955:26)
    at validator (http://localhost:7575/assets/index.js:18221:15)
    at applyOperation (http://localhost:7575/assets/index.js:18126:13)
    at applyPatch (http://localhost:7575/assets/index.js:18184:19)
    at Object.applyChanges (http://localhost:7575/assets/index.js:18498:15)
    at b.StateEventView [as constructor] (http://localhost:7575/assets/index.js:17116:16)
    at b.q$1 [as render] (http://localhost:7575/assets/index.js:260:15)
    at O (http://localhost:7575/assets/index.js:182:45)
    at S (http://localhost:7575/assets/index.js:94:214)
    at O (http://localhost:7575/assets/index.js:184:195)
```

Debugging it looks like maybe starting the state with `/` is the problem?

<img width="715" alt="image" src="https://github.com/user-attachments/assets/a8ae1f40-424a-4e5c-b0bd-1539f5b3da23">


The issue is actually in the viewer itself. It keeps a running copy of the state / store by replaying these events and in this case, we're improperly reseting the storage state whenever we hit a store event (so replaying subsequent events fails since any previous state changes have been lost). I should have a fix shortly, this issue is making me take a closer look at how we're tracking this state to make sure I think it's actually correct....