[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110846":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},110846,"Terminal-RSI","jyyang26\u002FTerminal-RSI","jyyang26","Official Codebase of \"Terminal-RSI: Recursive Self-Improving Terminal Agents via Recursive Self-Rewrite and Policy-Refine\"","https:\u002F\u002Fjyyang26.github.io\u002Fterminal-rsi",null,"Python",82,18,1,0,4,12,3,49.04,"Apache License 2.0",false,"main",true,[],"2026-10-25 03:25:28","2026-11-22 08:05:52","\u003Cdiv align=\"center\">\n\n# Terminal-RSI\n\n### Terminal-RSI: Recursive Self-Improving Terminal Agents via Recursive Self-Rewrite and Policy-Refine\n\n[![Paper](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper-arXiv%3A2610.22192-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2610.22192v1)\n[![Project Page](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-0052D9.svg)](https:\u002F\u002Fjyyang26.github.io\u002Fterminal-rsi)\n[![Model Weights](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Model%20Weights-ffc107.svg)](https:\u002F\u002Fhuggingface.co\u002FTeriminal-RSI)\n[![Python 3.10+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10%2B-3776AB.svg?logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002F)\n[![PyTorch](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyTorch-2.x-EE4C2C.svg?logo=pytorch&logoColor=white)](https:\u002F\u002Fpytorch.org\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](LICENSE)\n\n\n\n\u003C\u002Fdiv>\n\n\n\n## 📰 News\n\n- **[2026-10]** Code Release: Training recipes and framework for Terminal-RSI and RPR.\n- **[2026-10]** Code release: Code Release: Training recipes and framework for T1.\n\n## 📖 Overview\n\nTerminal agents must leave an executable environment in a state that passes a protected verifier; fluent plans and locally passed checks are not enough. Long-horizon learning faces **temporal dilation** between tokens and consequential actions, **value drift** after supervised policy changes, and **reward misalignment** between partial progress and strict completion.\n\n**Terminal-RSI** alternates adopted **Recursive Self-Rewrite (RSR)** with critic-inheriting **Recursive Policy-Refine (RPR)**. RSR transfers complementary-harness successes through runbook planning, leakage screening, and fresh verified execution into actor-only supervision. RPR recalibrates inherited values before joint PPO updates, coordinating turn-aware credit, evolving rewards, and stage-specific learning rates:\n\n- **Turn-Boundary Skip-Observation GAE (TB-GAE)** retains token-specific baselines while applying discount and trace decay only across interaction turns. Observations condition values but are not recursion nodes. Exact continuation across computational chunks requires both successor values and advantages on an unchanged input chain.\n- **Family Dense Reward (FDR)** calibrates semantic progress using frozen per-family divisors derived from historical check counts, rather than a single global reward scale.\n- **Success-Prioritized Reward (SPR)** combines strict-success credit with bounded, saturating partial progress: every failure scores below one and every success at least one.\n- **Recursive critic handoff.** An initial critic-only epoch prepares the Warm-up Critic Model. Actor-only RSR preserves critic weights; each RPR phase then performs four critic-only calibration updates before joint optimization, with a fivefold actor-rate reduction in the second cycle.\n\nFrom Qwen3.8-27B, **Base → RSR-1 → RPR-1 → RSR-2 → RPR-2** yields **Terminal-RSI-27B** (RPR-2, step 18): **19.84%** on Terminal-Bench 4.0, **86.52%** on 2.1, **16.95%** on 3.0, and **79.00%** on Hard. Four-suite macro-average success rises from **20.68%** to **50.58%**. LHTB process reward increases from **0.21** to **0.37**, with strict completion rising from **0\u002F46** to **5\u002F46**; SWR100 success doubles from **3.00%** to **6.00%**. Separately, rescoring 4,352 fixed trajectories with SPR reduces failed reward share from **50.09%** to **28.72%**, measuring reward allocation rather than an isolated online training effect.\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"assets\u002Ffigure1_rsi_main_results.png\" alt=\"Figure 1: five retained stages on terminal and long-horizon benchmarks\" width=\"100%\"\u002F>\n\u003Cp>\u003Cb>Figure 1. Evaluation across five retained stages on terminal and long-horizon benchmarks.\u003C\u002Fb> Positions order Base, RSR-1, RPR-1 (step 20), RSR-2, and RPR-2 (step 18, Terminal-RSI-27B), not equal compute intervals. Dashed lines and diamonds denote RSR; solid lines and stars denote retained RPR; gray branches show discarded alternatives. Terminal-Bench and SWR100 report Mean@3 success (%). LHTB separates mean strictly completed tasks (left axis) from process reward (right axis).\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n## 📊 Results\n\nPerformance of the five retained checkpoints marked in Figure 1, using the checkpoint scores from the accompanying results table. Terminal-Bench and SWR100 scores are success rates (%); LHTB reports average process reward, not a percentage.\n\n| Checkpoint | Terminal-Bench 4.0 | Terminal-Bench 2.1 | Terminal-Bench 3.0 | Terminal-Bench Hard | LHTB (process reward) | SWR100 |\n| --- | :---: | :---: | :---: | :---: | :---: | :---: |\n| Base (Qwen3.8-27B) | 0.00 | 51.70 | 0.00 | 31.00 | 0.21 | 3.00 |\n| RSR-1 | 6.10 | 70.10 | 6.80 | 54.00 | 0.29 | 5.00 |\n| RPR-1 (step 20) | 16.67 | 77.53 | 14.29 | 69.50 | 0.30 | 6.00 |\n| RSR-2 | 17.46 | **86.52** | 15.00 | 76.00 | 0.31 | 6.00 |\n| **Terminal-RSI-27B** (RPR-2, step 18) | **19.84** | **86.52** | **16.95** | **79.00** | **0.37** | **6.00** |\n\n## 🗂️ Repository Structure\n\nTerminal-RSI builds on [slime](https:\u002F\u002Fgithub.com\u002FTHUDM\u002Fslime) (Megatron training + SGLang rollout over Ray). The agentic RL integration is a plugin layer, so slime core stays close to upstream.\n\n```text\nTerminal-RSI\u002F\n├── train_async.py                 # RL entry point: rollout of step t+1 overlaps training on step t\n├── train.py                       # synchronous \u002F eval-only entry point\n├── examples\u002F\n│   ├── terminal_rsi\u002F              # ★ Terminal-RSI recipes (start here)\n│   │   ├── run_rpr1_fdr.sh        #   RPR-1 (Qwen3.8-27B): Family Dense Reward, actor lr 5e-7\n│   │   ├── run_rpr2_spr.sh        #   RPR-2 (Qwen3.8-27B): Success-Prioritized Reward, actor lr 1e-7\n│   │   ├── run_122b_terminal.sh   #   Qwen3.5-122B-A10B Terminal RL (MoE, 84k context)\n│   │   ├── run_eval.sh            #   rollout-only evaluation on a Harbor task pool\n│   │   ├── prepare_load_root.sh   #   actor \u002F critic load-root pair for warm handoff\n│   │   ├── common.sh              #   shared argument builder + Ray job submission\n│   │   └── configs\u002F               #   Harbor configs (FDR \u002F SPR divisor tables, 122B), per-role optimizer configs\n│   └── harbor_terminal_rl\u002F        # Harbor runtime deps + HF -> torch_dist conversion (27B, 122B)\n├── slime_plugins\u002F\n│   ├── harbor\u002F                    # ★ Terminal-agent RL plugin\n│   │   ├── rollout.py             #   Harbor\u002FTerminus-2 agentic rollout (generate_rollout)\n│   │   ├── data_source.py         #   task-pool data source with per-epoch shuffling\n│   │   ├── partial_reward.py      #   FDR (test_count_progress_rewards) and SPR (success_smoothed_progress_rewards)\n│   │   ├── tb_gae*.py             #   TB-GAE: turn-boundary advantages, chunk boundaries, termination\n│   │   ├── atif_adapter.py        #   Harbor trial → token-exact training samples\n│   │   ├── sample_postprocess.py  #   256k token caps and response trimming\n│   │   ├── train_loss.py          #   PPO policy loss used by RPR\n│   │   └── agent.py, llm.py, ...  #   Terminus-2 agent bound to the SGLang policy server\n│   └── models\u002F                    # Qwen3.5\u002F3.8 (GatedDeltaNet hybrid) Megatron specs\n├── slime\u002F                         # training framework (Megatron backend, SGLang rollout, Ray orchestration)\n│   ├── backends\u002Fmegatron_utils\u002F   #   actor\u002Fcritic training, TB-GAE bootstrap values\n│   ├── ray\u002F                       #   placement groups, actor\u002Fcritic groups, warm-critic loading\n│   └── utils\u002F                     #   arguments (incl. TB-GAE flags), PPO utilities\n├── tools\u002F                         # checkpoint conversion (torch_dist ↔ HF), reward analysis scripts\n├── tests\u002F                         # CPU unit tests (rewards, TB-GAE math, Harbor adapters) + GPU E2E tests\n├── docker\u002F  build_conda.sh        # environment\n├── docs\u002F                          # slime documentation and development notes\n└── assets\u002F                        # paper figures\n```\n\n## ⚙️ Installation\n\nTerminal-RSI needs a CUDA build of SGLang and Megatron-LM. The most reliable path is the slime Docker image; a conda recipe pinning the same commits is also provided.\n\n**Option A: Docker (recommended).**\n\n```bash\ndocker pull slimerl\u002Fslime:latest           # see docker\u002F for the pinned tag and patches\ndocker run --gpus all --ipc=host --shm-size=64g -it slimerl\u002Fslime:latest bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjyyang26\u002FTerminal-RSI.git && cd Terminal-RSI\npip install -e . --no-deps\n```\n\n**Option B: Conda \u002F micromamba.**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjyyang26\u002FTerminal-RSI.git && cd Terminal-RSI\nbash build_conda.sh                        # env \"slime\": Python 3.12, CUDA 12.9, PyTorch, pinned SGLang + Megatron-LM\nmicromamba activate slime\npip install -e . --no-deps\n```\n\n**Agent runtime.** Install [Harbor](https:\u002F\u002Fgithub.com\u002Fharbor-framework\u002Fharbor) (the Terminal-Bench harness) and the context-parallel kernels for the GatedDeltaNet layers:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fharbor-framework\u002Fharbor.git \u002Fopt\u002Fharbor\nexport HARBOR_SRC=\u002Fopt\u002Fharbor\u002Fsrc                         # put on PYTHONPATH by the launchers\nINSTALL_DAYTONA=1 bash examples\u002Fharbor_terminal_rl\u002Finstall_harbor_runtime_deps.sh\npip install \"fla-core>=0.4.2\" \"flash-linear-attention>=0.4.2\"   # fla.ops.cp is required for CP>1\n```\n\nRollouts execute in [Daytona](https:\u002F\u002Fwww.daytona.io\u002F) sandboxes (`environment.type: daytona`), so export `DAYTONA_API_KEY`. Set `WANDB_API_KEY` for logging, or `USE_WANDB=0` to disable it.\n\n**Sanity check (CPU only).**\n\n```bash\npython -m pytest tests\u002Ftest_terminal_rsi_rewards.py tests\u002Ftest_tb_gae_math.py tests\u002Ftest_harbor_partial_reward.py -q\n```\n\n## 🚀 Quickstart\n\n### 1. Prepare checkpoints and data\n\nFor HF-to-Megatron conversion, set `NPROC_PER_NODE`, `TENSOR_MODEL_PARALLEL_SIZE`,\n`PIPELINE_MODEL_PARALLEL_SIZE`, and `MODEL_SCRIPT` for your environment as described\nin [`examples\u002Fharbor_terminal_rl\u002FREADME.md`](examples\u002Fharbor_terminal_rl\u002FREADME.md).\n\n```bash\n# HF -> Megatron torch_dist (configure conversion resources for your environment)\nHF_CKPT=\u002Fpath\u002Fto\u002FQwen3.8-27B SAVE_DIR=\u002Fpath\u002Fto\u002FQwen3.8-27B_torch_dist \\\n    bash examples\u002Fharbor_terminal_rl\u002Fconvert_q38_27b_base_torch_dist.sh\n\nexport HF_CKPT=\u002Fpath\u002Fto\u002FQwen3.8-27B\nexport TASKS_DIR=\u002Fpath\u002Fto\u002Fswr_tasks              # Harbor tasks: \u003CTASKS_DIR>\u002F*\u002Ftask.toml with CTRF-emitting verifiers\nexport EVAL_TASKS_DIR=\u002Fpath\u002Fto\u002Fterminal-bench-2  # held-out pool:  \u003CEVAL_TASKS_DIR>\u002F*\u002Ftask.toml\nexport HARBOR_SRC=\u002Fopt\u002Fharbor\u002Fsrc\nexport DAYTONA_API_KEY=...\n```\n\nFDR\u002FSPR read the task family from `tests\u002Fprivate\u002Fmanifest.json` (`family_id`) and the passed-check count from the verifier's `verifier\u002Fctrf.json`. Tasks without a valid CTRF report fall back to the binary success reward.\n\n### 2. RL training (RPR)\n\nThe training launchers require a running Ray cluster and an explicit resource configuration for your environment. Set `ACTOR_NUM_NODES`, `ACTOR_NUM_GPUS_PER_NODE`, `ROLLOUT_NUM_GPUS`, `ROLLOUT_NUM_GPUS_PER_ENGINE`, `TENSOR_MODEL_PARALLEL_SIZE`, `PIPELINE_MODEL_PARALLEL_SIZE`, and `CONTEXT_PARALLEL_SIZE` before launching; no experiment-specific resource defaults are provided. RPR uses a 256k context window and a batch of 256 trajectories per step. See [`examples\u002Fterminal_rsi\u002FREADME.md`](examples\u002Fterminal_rsi\u002FREADME.md) for resource requirements. Use `DRY_RUN=1` to inspect the generated command without launching training.\n\n```bash\n# RPR-1: RSR-1 actor + Warm-up Critic, Family Dense Reward\nbash examples\u002Fterminal_rsi\u002Fprepare_load_root.sh \\\n     \u002Fckpt\u002Frsr1\u002Fiter_XXXXXXX \u002Fckpt\u002Fwarmup_critic\u002Fiter_XXXXXXX \u002Fckpt\u002Floadroot_rpr1\nLOAD_ROOT=\u002Fckpt\u002Floadroot_rpr1 bash examples\u002Fterminal_rsi\u002Frun_rpr1_fdr.sh\n\n# RPR-2: RSR-2 actor + critic retained from RPR-1, Success-Prioritized Reward\nbash examples\u002Fterminal_rsi\u002Fprepare_load_root.sh \\\n     \u002Fckpt\u002Frsr2\u002Fiter_XXXXXXX \u002Fckpt\u002Frpr1\u002Fcheckpoints_critic\u002Fiter_XXXXXXX \u002Fckpt\u002Floadroot_rpr2\nLOAD_ROOT=\u002Fckpt\u002Floadroot_rpr2 bash examples\u002Fterminal_rsi\u002Frun_rpr2_spr.sh\n```\n\n| | RPR-1 | RPR-2 |\n| --- | --- | --- |\n| Actor init \u002F critic init | RSR-1 \u002F Warm-up Critic | RSR-2 \u002F retained RPR-1 critic |\n| Reward hook | `partial_reward.test_count_progress_rewards` (FDR) | `partial_reward.success_smoothed_progress_rewards` (SPR) |\n| Harbor config | `configs\u002Fharbor_rpr1_fdr.yaml` | `configs\u002Fharbor_rpr2_spr.yaml` |\n| Actor \u002F critic lr | 5e-7 \u002F 1.5e-5 | 1e-7 \u002F 1.5e-5 |\n| Critic-only calibration steps | 4 | 4 |\n| PPO clip (low \u002F high), value clip | 0.3 \u002F 5.0, 4.0 | 0.3 \u002F 5.0, 4.0 |\n| Rollouts, batch, oversampling | 36, 256, 288 | 36, 256, 288 |\n| Retained checkpoint | step 20 | step 18 (**Terminal-RSI-27B**) |\n\nThe **Warm-up Critic** uses the same launcher with a cold value head: build an actor-only root (`prepare_load_root.sh \u003Cactor> none \u003Croot>`) and run with `WARM_CRITIC=0 NUM_CRITIC_ONLY_STEPS=\u003CN> NUM_ROLLOUT=\u003CN>`, where `N` covers one epoch of the task pool. **TB-GAE** is enabled by default for RPR-1 in `configs\u002Fharbor_rpr1_fdr.yaml`, with `tb_gae_gamma_turn: 1.0` and `tb_gae_lambda_turn: 1.0`. Override the turn discounts with `EXTRA_ARGS=\"--tb-gae-gamma-turn \u003Cγ> --tb-gae-lambda-turn \u003Cλ>\"`, or explicitly disable it with `EXTRA_ARGS=\"--no-enable-tb-gae\"`. The **RSR** stages are supervised fine-tuning on verified rewritten trajectories (see slime's SFT recipes, e.g. `scripts\u002Frun-qwen3-4B-base-sft.sh`); the RSR data pipeline itself follows the RSR paper and is not part of this release.\n\n**Qwen3.5-122B-A10B Terminal RL.** The same stack also trains the 256-expert MoE model at\n84k context with batch 512, the CTRF progress reward, and rollout routing replay.\nConfigure the training and rollout resources for your environment, including\n`EXPERT_MODEL_PARALLEL_SIZE` and `EXPERT_TENSOR_PARALLEL_SIZE` for MoE training:\n\n```bash\nHF_CKPT=\u002Fpath\u002Fto\u002FQwen3.5-122B-A10B SAVE_DIR=\u002Fpath\u002Fto\u002FQwen3.5-122B-A10B_torch_dist \\\n    bash examples\u002Fharbor_terminal_rl\u002Fconvert_qwen35_122b_a10b_torch_dist.sh\nbash examples\u002Fterminal_rsi\u002Fprepare_load_root.sh \\\n     \u002Fpath\u002Fto\u002FQwen3.5-122B-A10B_torch_dist\u002Fiter_XXXXXXX none \u002Fckpt\u002Floadroot_122b\nWARM_CRITIC=0 HF_CKPT=\u002Fpath\u002Fto\u002FQwen3.5-122B-A10B LOAD_ROOT=\u002Fckpt\u002Floadroot_122b \\\nTASKS_DIR=\u002Fpath\u002Fto\u002Fstrategy15k\u002Ftasks bash examples\u002Fterminal_rsi\u002Frun_122b_terminal.sh\n```\n\nSee [`examples\u002Fterminal_rsi\u002FREADME.md`](examples\u002Fterminal_rsi\u002FREADME.md) for all options (resume, dry run, TB-GAE, ...).\n\n### 3. Evaluation\n\nTraining evaluates on `EVAL_TASKS_DIR` every 10 steps (3 samples per task, temperature 1.0, top-p 0.95, top-k 20). To evaluate a checkpoint standalone, convert it to HF format and run the rollout-only evaluator:\n\n```bash\n# Megatron torch_dist -> HuggingFace\nPYTHONPATH=\u002Froot\u002FMegatron-LM python tools\u002Fconvert_torch_dist_to_hf.py \\\n    --input-dir \u002Fckpt\u002Frpr2\u002Fcheckpoints\u002Fiter_0000018 \\\n    --output-dir \u002Fckpt\u002Fterminal_rsi_27b_hf \\\n    --origin-hf-dir \u002Fpath\u002Fto\u002FQwen3.8-27B --vocab-size 248320\n\n# Rollout-only evaluation on any Harbor task pool (e.g. Terminal-Bench 2.x \u002F 3.0 \u002F 4.0 \u002F Hard)\nHF_CKPT=\u002Fckpt\u002Fterminal_rsi_27b_hf EVAL_TASKS_DIR=\u002Fpath\u002Fto\u002Fterminal-bench-2 \\\n    bash examples\u002Fterminal_rsi\u002Frun_eval.sh\n```\n\n### 4. Inference\n\nThe converted checkpoint is a standard HuggingFace model and can be served with SGLang, then driven by any Harbor agent (Terminus-2 in our experiments):\n\n```bash\npython -m sglang.launch_server --model-path \u002Fckpt\u002Fterminal_rsi_27b_hf \\\n    --tp \"${ROLLOUT_NUM_GPUS_PER_ENGINE}\" --context-length 262144 --mamba-scheduler-strategy extra_buffer --port 30000\n```\n\n## 📝 Citation\n\nIf you find Terminal-RSI useful, please cite [our paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2610.22192v1):\n\n```bibtex\n@misc{yang2026terminalrsi,\n  title         = {Terminal-RSI: Recursive Self-Improving Terminal Agents via Recursive Self-Rewrite and Policy-Refine},\n  author        = {Yang, Junyao and Li, Zongxia and Shi, Yucheng and Li, Zhongzhi and Wang, Ruhan and Zhou, Ruiwen and Mi, Haitao and Yan, Shuicheng and Liang, Leowei},\n  year          = {2026},\n  eprint        = {2610.22192},\n  archivePrefix = {arXiv},\n  url           = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2610.22192v1}\n}\n```\n\nTerminal-RSI and [T1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.11042) share the same terminal-agent reinforcement-learning training framework. If you use this training framework, please also cite T1:\n\n```bibtex\n@misc{yang2026t1terminalagentreinforcement,\n  title         = {T1: Terminal Agent Reinforcement Learning for Long-Horizon Tasks},\n  author        = {Junyao Yang and Yucheng Shi and Zhongzhi Li and Ruhan Wang and Zongxia Li and Haitao Mi and Leowei Liang},\n  year          = {2026},\n  eprint        = {2609.11042},\n  archivePrefix = {arXiv},\n  primaryClass  = {cs.LG},\n  url           = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.11042}\n}\n```\n\n## 📄 License\n\nThis project is released under the [Apache License 2.0](LICENSE). It is derived from [slime](https:\u002F\u002Fgithub.com\u002FTHUDM\u002Fslime), which is also Apache-2.0 licensed; third-party components keep their original licenses.\n\n## 🙏 Acknowledgements\n\nWe sincerely thank the authors and contributors of [slime](https:\u002F\u002Fgithub.com\u002FTHUDM\u002Fslime), [SGLang](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002Fsglang), and [Megatron-LM](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM) for their open-source work. These projects provide the foundation for Terminal-RSI's reinforcement-learning framework, rollout inference, and distributed model training, respectively.\n\nTerminal-RSI also builds on [Ray](https:\u002F\u002Fgithub.com\u002Fray-project\u002Fray). Agent execution uses [Harbor](https:\u002F\u002Fgithub.com\u002Fharbor-framework\u002Fharbor), [Terminal-Bench](https:\u002F\u002Fgithub.com\u002Flaude-institute\u002Fterminal-bench), and [Daytona](https:\u002F\u002Fwww.daytona.io\u002F) sandboxes. We follow the distributed terminal-RL infrastructure of T1 and adopt the Recursive Self-Rewrite procedure of RSR. We thank the authors and contributors of these projects as well.\n\n## 📬 Contact\n\nJunyao Yang: [junyaoyang@u.nus.edu](mailto:junyaoyang@u.nus.edu)\n","Terminal-RSI 是一个面向终端环境的递归式自我改进智能体框架，旨在提升大语言模型在需严格终端状态验证任务中的长程执行可靠性。其核心采用交替迭代的递归自重写（RSR）与递归策略精炼（RPR）机制，结合Turn-Boundary GAE、Family Dense Reward 和 Success-Prioritized Reward 等原创强化学习设计，缓解时序稀释、价值漂移与奖励错位问题。项目提供完整训练流程与模型权重，适用于需精确终端状态控制的自动化任务，如可信脚本执行、安全敏感的系统运维、可验证命令链生成等场景。",2,"2026-11-24 04:39:45","CREATED_QUERY"]