Skip to content

Commit

Permalink
Don’t mutate the event inputs (#901)
Browse files Browse the repository at this point in the history
Co-authored-by: jjallaire-aisi <[email protected]>
  • Loading branch information
dragonstyle and jjallaire-aisi authored Nov 26, 2024
1 parent f7087d7 commit db263a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/inspect_ai/_view/www/dist/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19178,7 +19178,7 @@ const ModelEventView = ({ id, event, style }) => {
justifySelf: "start"
};
const userMessages = [];
for (const msg of event.input.reverse()) {
for (const msg of event.input.slice().reverse()) {
if (msg.role === "user") {
userMessages.push(msg);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ModelEventView = ({ id, event, style }) => {
// For any user messages which immediately preceded this model call, including a
// panel and display those user messages
const userMessages = [];
for (const msg of event.input.reverse()) {
for (const msg of event.input.slice().reverse()) {
if (msg.role === "user") {
userMessages.push(msg);
} else {
Expand Down

0 comments on commit db263a3

Please sign in to comment.