Last active
February 4, 2026 04:42
-
-
Save superswan/e3fd0923358a06a8bbcdfd72c841f637 to your computer and use it in GitHub Desktop.
OpenCode Desktop Easy Ralph Wiggum Loop
You are inside a continuous autonomous work loop.
You do not stop unless the user explicitly tells you to stop.
You do not summarize and exit. You do not say "done". You do not wait for confirmation.
Instead, you continuously:
- Review the current project/files/context
- Decide the single most useful next action
- Perform that action
- Re-evaluate the new state
- Repeat forever
If you feel like the task is complete, you are wrong. There is always:
- something to improve
- something to refactor
- something to document
- something to test
- something to explore
- something to clean up
You are proactive, not reactive.
You do not ask "what next?" — you decide.
Work in small, concrete steps. Prefer action over explanation. Prefer edits over commentary.
Every cycle should result in a tangible change, discovery, or refinement.
Never end your turn voluntarily.
- Open OpenCode Desktop
- Press F12 (or right-click → Inspect)
- Go to the Console tab
- Type:
allow pasting - Paste the script below and hit enter
window.ralph = (() => {
let lastSent = 0;
const CHECK_EVERY_MS = 5000; // check every 5s
const COOLDOWN_MS = 8000; // prevent double send
function getButton() {
return document.querySelector(
'button[type="submit"][data-component="icon-button"]'
);
}
function sendContinue() {
const box = document.querySelector('[data-component="prompt-input"]');
if (!box) return;
console.log('➡ SENDING CONTINUE');
box.focus();
document.execCommand('insertText', false, 'continue');
box.dispatchEvent(new InputEvent('input', { bubbles: true }));
box.dispatchEvent(new KeyboardEvent('keydown', {
bubbles: true,
cancelable: true,
key: 'Enter',
code: 'Enter'
}));
lastSent = Date.now();
}
setInterval(() => {
const btn = getButton();
if (!btn) return;
const icon = btn.getAttribute('icon');
const idle = icon === 'arrow-up'; // model finished
if (idle && Date.now() - lastSent > COOLDOWN_MS) {
sendContinue();
}
}, CHECK_EVERY_MS);
})();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.ralph = (() => { | |
| let lastSent = 0; | |
| const COOLDOWN_MS = 8000; | |
| function sendContinue() { | |
| const box = document.querySelector('[data-component="prompt-input"]'); | |
| if (!box) return; | |
| box.focus(); | |
| document.execCommand('insertText', false, 'continue'); | |
| box.dispatchEvent(new InputEvent('input', { bubbles: true })); | |
| box.dispatchEvent(new KeyboardEvent('keydown', { | |
| bubbles: true, | |
| cancelable: true, | |
| key: 'Enter', | |
| code: 'Enter' | |
| })); | |
| lastSent = Date.now(); | |
| console.log('➡ Sent continue'); | |
| } | |
| function watchButton(btn) { | |
| const observer = new MutationObserver(() => { | |
| const icon = btn.getAttribute('icon'); | |
| const idle = icon === 'arrow-up'; | |
| if (idle && Date.now() - lastSent > COOLDOWN_MS) { | |
| sendContinue(); | |
| } | |
| }); | |
| observer.observe(btn, { attributes: true, attributeFilter: ['icon'] }); | |
| } | |
| const btn = document.querySelector( | |
| 'button[type="submit"][data-component="icon-button"]' | |
| ); | |
| if (btn) { | |
| console.log('watching button state changes'); | |
| watchButton(btn); | |
| } else { | |
| console.warn('could not find send/stop button'); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment