SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]
Web: Various Styling improvements
Kilian Lieretb41d7f6cee8e
diff --git a/sweagent/api/hooks.py b/sweagent/api/hooks.pyindex 81ffba0f..c49bb827 100644--- a/sweagent/api/hooks.py+++ b/sweagent/api/hooks.py@@ -100,7 +100,7 @@ class AgentUpdateHook(AgentHook):def on_sub_action_started(self, *, sub_action: dict):# msg = f"```bash\n{sub_action['action']}\n```"- msg = sub_action["action"].strip()+ msg = "$ " + sub_action["action"].strip()self._sub_action = sub_action["action"].strip()self._wu.up_env(message=msg, thought_idx=self._thought_idx, type_="command")diff --git a/sweagent/frontend/src/components/AgentMessage.js b/sweagent/frontend/src/components/AgentMessage.jsindex e87c35fb..bf999c71 100644--- a/sweagent/frontend/src/components/AgentMessage.js+++ b/sweagent/frontend/src/components/AgentMessage.js@@ -1,6 +1,7 @@import React from 'react';import "../static/message.css";+import "../static/agentMessage.css";const AgentMessage = ({ item, handleMouseEnter, isHighlighted, feedRef }) => {const stepClass = item.step !== null ? `step${item.step}` : '';@@ -11,7 +12,7 @@ const AgentMessage = ({ item, handleMouseEnter, isHighlighted, feedRef }) => {className={`message ${item.format} ${stepClass} ${highlightClass}`}onMouseEnter={() => handleMouseEnter(item, feedRef)}>- { item.title && <h4>{item.title}</h4>}+ { item.title && <span className="agentMessageTitle badge badge-dark">{item.title}</span>}<span>{item.message}</span></div>);diff --git a/sweagent/frontend/src/components/EnvMessage.js b/sweagent/frontend/src/components/EnvMessage.jsindex b96ded2f..3bbf1020 100644--- a/sweagent/frontend/src/components/EnvMessage.js+++ b/sweagent/frontend/src/components/EnvMessage.js@@ -55,7 +55,7 @@ const EnvMessage = ({ item, handleMouseEnter, isHighlighted, feedRef}) => {className={`message ${item.format} ${stepClass} ${highlightClass} ${messageTypeClass}`}onMouseEnter={() => handleMouseEnter(item, feedRef)}>- <p+ <divcodeTagProps={codeTagProps}customStyle={{customStyleMerged, overflow: 'hidden'}}language={language}@@ -65,7 +65,7 @@ const EnvMessage = ({ item, handleMouseEnter, isHighlighted, feedRef}) => {showLineNumbers={false}>{item.message}- </p>+ </div></div>);} else {diff --git a/sweagent/frontend/src/components/controls/LRunControl.js b/sweagent/frontend/src/components/controls/LRunControl.jsindex 315da188..f1d0ad9a 100644--- a/sweagent/frontend/src/components/controls/LRunControl.js+++ b/sweagent/frontend/src/components/controls/LRunControl.js@@ -2,6 +2,7 @@ import React, { useState } from 'react';import { Tab, Tabs } from 'react-bootstrap';import Form from 'react-bootstrap/Form';import '../../static/runControl.css';+import { PlayFill, StopFill} from 'react-bootstrap-icons';function LRunControl({isComputing, isConnected, handleStop, handleSubmit, setDataPath, setTestRun, dataPath, testRun, repoPath, setRepoPath}) {const [psType, setPsType] = useState('gh');@@ -58,6 +59,7 @@ function LRunControl({isComputing, isConnected, handleStop, handleSubmit, setDat</div></Tab><Tab eventKey="model" title="Model">+ <div>Model settings coming soon.</div></Tab><Tab eventKey="settings" title="Extra Settings"><div className="p-3">@@ -72,8 +74,8 @@ function LRunControl({isComputing, isConnected, handleStop, handleSubmit, setDat</Tabs><br/><div class="btn-group" role="group" aria-label="Basic example">- <button type="submit" className="btn btn-primary" onClick={handleSubmit} disabled={isComputing || !isConnected}>Run</button>- <button onClick={handleStop} disabled={!isComputing} className="btn btn-primary">Stop</button>+ <button type="submit" className="btn btn-primary" onClick={handleSubmit} disabled={isComputing || !isConnected}><PlayFill/> Run</button>+ <button onClick={handleStop} disabled={!isComputing} className="btn btn-primary"><StopFill/> Stop</button></div></div>);diff --git a/sweagent/frontend/src/components/panels/AgentFeed.js b/sweagent/frontend/src/components/panels/AgentFeed.jsindex 0d7d67c9..d2495ddd 100644--- a/sweagent/frontend/src/components/panels/AgentFeed.js+++ b/sweagent/frontend/src/components/panels/AgentFeed.js@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';import Message from '../AgentMessage';import workspaceLogo from '../../assets/panel_icons/workspace.png';+import "../../static/agentFeed.css";function useScrollToBottom(feed, ref) {useEffect(() => {@@ -17,7 +18,7 @@ const AgentFeed = ({ feed, id, title, highlightedStep, handleMouseEnter, selfRefconst feedID = id + "Feed";return (- <div id={feedID} className={feedID}>+ <div id="agentFeed" className="agentFeed"><div id="label"><img src={workspaceLogo} alt="workspace" /><span>{title}</span>diff --git a/sweagent/frontend/src/components/panels/EnvFeed.js b/sweagent/frontend/src/components/panels/EnvFeed.jsindex 6f5b488f..14f5c47e 100644--- a/sweagent/frontend/src/components/panels/EnvFeed.js+++ b/sweagent/frontend/src/components/panels/EnvFeed.js@@ -3,6 +3,7 @@ import EnvMessage from '../EnvMessage';import MacBar from '../MacBar';import terminalLogo from '../../assets/panel_icons/terminal.png';+import "../../static/envFeed.css";function useScrollToBottom(feed, ref) {useEffect(() => {@@ -15,10 +16,8 @@ function useScrollToBottom(feed, ref) {const EnvFeed = ({ feed, id, title, highlightedStep, handleMouseEnter, selfRef, setIsTerminalExpanded}) => {useScrollToBottom(feed, selfRef);- const feedID = id + "Feed";-return (- <div id={feedID} className={feedID}>+ <div id="envFeed" className="envFeed"><div id="label"><img src={terminalLogo} alt="workspace" /><span>{title}</span>diff --git a/sweagent/frontend/src/components/panels/LogPanel.js b/sweagent/frontend/src/components/panels/LogPanel.jsindex a342a772..881901f0 100644--- a/sweagent/frontend/src/components/panels/LogPanel.js+++ b/sweagent/frontend/src/components/panels/LogPanel.js@@ -1,6 +1,7 @@import React, { useEffect } from 'react';import MacBar from '../MacBar';import editorLogo from '../../assets/panel_icons/editor.png';+import "../../static/logPanel.css";import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap';import { Clipboard } from 'react-bootstrap-icons';@@ -49,14 +50,11 @@ const LogPanel = ({ logs, logsRef, setIsTerminalExpanded}) => {<pre id="logContent">{logs}</pre><div style={{ clear: "both", marginTop: '1em' }}/></div>- <OverlayTrigger- placement="top"- overlay={<Tooltip id="copy-tooltip">Copy to Clipboard</Tooltip>}- >- <Button variant="light" onClick={handleCopy}>- <Clipboard />- </Button>- </OverlayTrigger>+ <div style={{ display: 'flex', justifyContent: 'right', width: '100%' }}>+ <Button variant="light" onClick={handleCopy} style={{marginBottom: 20, marginRight: 20}}>+ <Clipboard /> Copy to clipboard+ </Button>+ </div></div></div>);diff --git a/sweagent/frontend/src/static/agentFeed.css b/sweagent/frontend/src/static/agentFeed.cssnew file mode 100644index 00000000..f355b563--- /dev/null+++ b/sweagent/frontend/src/static/agentFeed.css@@ -0,0 +1,3 @@+.agentFeed .scrollableDiv {+ border-radius: 0.5em !important;+}\ No newline at end of filediff --git a/sweagent/frontend/src/static/agentMessage.css b/sweagent/frontend/src/static/agentMessage.cssnew file mode 100644index 00000000..5073890e--- /dev/null+++ b/sweagent/frontend/src/static/agentMessage.css@@ -0,0 +1,4 @@+.agentMessageTitle {+ font-weight: bold;+ color: black;+}\ No newline at end of filediff --git a/sweagent/frontend/src/static/envFeed.css b/sweagent/frontend/src/static/envFeed.cssnew file mode 100644index 00000000..e69de29bdiff --git a/sweagent/frontend/src/static/envMessage.css b/sweagent/frontend/src/static/envMessage.cssindex d2668375..cce94364 100644--- a/sweagent/frontend/src/static/envMessage.css+++ b/sweagent/frontend/src/static/envMessage.css@@ -1,7 +1,7 @@.envMessageCommand {border-radius: 1em 1em 0em 0em;margin: 1em 1em 0em 1em;- border-bottom: 1px dashed black;+ /* border-bottom: 1px dashed black; */}.envMessageOutput{diff --git a/sweagent/frontend/src/static/logPanel.css b/sweagent/frontend/src/static/logPanel.cssnew file mode 100644index 00000000..8b01919f--- /dev/null+++ b/sweagent/frontend/src/static/logPanel.css@@ -0,0 +1,3 @@+.logPanel .innerDiv {+ padding-left: 1em;+}\ No newline at end of file