Skip to content

Instantly share code, notes, and snippets.

@NyaMisty
Last active August 17, 2025 22:18
Show Gist options
  • Save NyaMisty/850f6b126d7425a71a1d4d35f29a094a to your computer and use it in GitHub Desktop.
Save NyaMisty/850f6b126d7425a71a1d4d35f29a094a to your computer and use it in GitHub Desktop.
Make Trae automatically "continue"
// tested on Trae v2.0.1 20250719
// Trae 全自动继续 (Trae Full Auto)
// will only continues ("继续") if it detects "模型思考次数已达上限"
// paste the code in Trae's developer tool console
window.$ = $
clearInterval(window.autoContinue)
window.autoContinue = setInterval(function() {
var continueText = '继续'
var lastMsg = $('#mc-agent-content-container > div > div > div:last-child > section > div.agent-error-wrap')
if (lastMsg && lastMsg.innerText.startsWith('模型思考次数已达上限') || lastMsg.innerText.startsWith('输出过长') || lastMsg.innerText.startsWith('模型响应超时')) {
console.log('not finished, need more!')
let editor = $('div.chat-input-v2-input-box-editable')
editor.focus()
let evt = new InputEvent('input', { inputType: 'insertText', data: continueText, isComposing: false, bubbles: true, cancelable: false })
editor.dispatchEvent(evt)
var button = $('div.chat-input-v2-editor-part-lower__right > button.chat-input-v2-send-button')
setTimeout(function() {
button.click()
}, 300)
} else {
//console.log('finished!')
}
}, 5000)
@NyaMisty
Copy link
Author

绕过最大6000字符限制
og = function() { const ret = window.ori_og.apply(this, arguments); if (!ret||!ret.props||!ret.props.children||ret.props.children.length<2||!ret.props.children[1]||!ret.props.children[1].props) { return ret; } ret.props.children[1].props.maxLength = 600000; return ret; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment