S-Agent 2.0: Achieving Spatial Reasoning with a General-Purpose Coding AgentS-Agent 2.0: Spatial Reasoning with a General Coding Agent
S-Agent 2.0 uses a coding agent to close the loop on spatial evidence; on Qwen3.8-27B, MMSI 66.5 and ReVSI 82.3.
- Spatial reasoning requires judging the position, relations, and motion of objects in 3D. Agents can use 3D tools to obtain evidence, but the authors state that even when the readings are correct the answer is still often wrong: the sign or coordinate frame is read backwards, or the evidence is not used and the model instead looks at the image. The authors place the gap in memory and interpretation after acquisition.
- S-Agent 2.0 does not change the general coding agent, and only adds command-line perception tools. Reconstruction, segmentation, and model-registered instances are written into persistent scene memory, then queried by name, readouts are returned in spatial language, and the geometry still comes from the tools.
- S-Agent 2.0 on Qwen3.8-27B is MMSI 66.5, ReVSI 82.3, higher than SpatialClaw on the same backbone. Gemini-3.8-Flash is 74.1, 90.5. Under the no-tool control, Qwen's ReVSI gain is +20.5.
- The paper does not write a dedicated section on limitations or future directions. The experiments cover five spatial benchmarks, two backbones, and OpenHands, Codex, Claude Code. The perception model is frozen. In Appendix C, MMSI-Bench and ReVSI each have 1000 questions. The paper does not report the number of repeats.
- Evaluated models
- Qwen3.8-27BGemini-3.8-Flash
- Benchmarks
- MMSI-BenchMindCubeSPAR-BenchReVSIMMSI-Video-Bench
- Metrics
- overall accuracymacro-averaged scoremean relative accuracy
S-Agent 2.0 improves spatial reasoning by adding a command-line perception toolkit, persistent scene memory, and natural language interpretation to a general-purpose coding agent. On MMSI-Bench and ReVSI, the toolkit improves Qwen3.8-27B by 13.9 and 20.5 points, respectively, and Gemini-3.8-Flash by 11.2 and 9.6 points. S-Agent 2.0 achieves 66.5 and 82.3 on open-source backbones, surpassing SpatialClaw's 62.6 and 74.5, and can be used with coding agent frameworks such as Codex and Claude Code.
Paper analysis
What problem does this paper attempt to solve?
The model still answers incorrectly when tool readings are correct; S-Agent 2.0 uses a coding agent to close the evidence loop.
In spatial reasoning, 3D tools already give correct readings, yet the model still often fails to reach the correct answer.
- Where it arises: The authors state that spatial intelligence requires judging the position and relations of objects in 3D, and how the world appears after a person moves; this is the foundation of visual perception and is needed by agents acting in the physical world.
- Current shortcomings: The authors state that agentic VLMs no longer answer in a single pass but use 3D perception tools to gather evidence while reasoning, bringing large improvements. Even so, on many questions the tool evidence is correct but the answer is still wrong (Figure 4). After analyzing SpatialClaw trajectories, the authors state that acquisition is rarely where the failure lies.
- Two kinds of failure: One kind misreads an existing reading, for example flipping the sign of a correctly measured rotation, or understanding a number in the wrong coordinate frame or wrong direction; the other kind is evidence that does not reach the answer, where the measurement stays in the workspace and the model instead looks at the image, or discards a correct reading for an irrelevant reason.
- The authors' requirement: A complete evidence loop must acquire measurements, remember them until the rest of the evidence is in place, and interpret the readings into the spatial language used by the question. The authors state that specialized systems invest almost only in acquisition, leaving memory and interpretation to the model, with the model's own perception in yet another channel.
- This paper's approach: S-Agent 2.0 uses an off-the-shelf general coding agent plus command-line perception tools designed around these three items; it does not train the backbone and runs on different coding harnesses.
What related research exists?
The authors place this paper in inference-time forensics, rather than training spatial ability into the weights or merely stacking perception libraries.
Spatial reasoning written into weights
- Instruction data: Appendix A classifies SpatialVLM, SpatialRGPT, Cambrian-S, and SenseNova-SI as distilling 3D annotations into large-scale spatial instruction data.
- Structure and training signals: Spatial-MLLM and VST change the backbone or do spatial fine-tuning; SpaceR, ViLaSR, MindCube, and SpatialLadder use reinforcement learning, verifiable rewards, or curricula.
- The authors' contrast: The authors state that these models answer via a single forward pass using what training left in the parameters, without measuring the scene in front of them; changing the perception backend or task distribution requires retraining.
Tool augmentation and code actions
- Interleaved calls: ReAct interleaves reasoning with calls to external modules on the language side.
- Visual tools: VisProg and ViperGPT synthesize an entire program at once and then execute it; MM-ReAct, HuggingGPT, and OctoTools dispatch round by round according to a tool menu; PyVision writes tools as it goes.
- Action format: The authors relay CodeAct's comparison: executable code is better than JSON or free text. The authors state that the tools of these systems target 2D recognition, and the controller need not maintain a metric 3D scene across viewpoints and time.
Agentic spatial reasoning
- Programs and scenes: VADAR synthesizes task-specific Python APIs and then writes programs; pySpatial composes reconstruction, camera poses, and novel view synthesis into 3D vision programs; GCA formalizes the problem as geometric constraints and then executes tools; RieMind queries an explicit 3D scene graph with typed geometric operations.
- Fine-tuning and rendering: SpaceTools uses supervised demonstrations plus interactive reinforcement learning to fine-tune a VLM to coordinate a fixed toolset; Think3D selects camera viewpoints, renders reconstructed point clouds, and then reasons over the images.
- Recent systems: S-Agent schedules 3D operations over multi-view and long video; SpatialClaw uses a hand-crafted plan, act, reflect loop to drive a persistent code kernel with 3D perception and geometric tools. The authors state that these systems write specialized controllers, with design effort mainly spent on acquisition, memory and interpretation left to the model, and the model's own perception kept in a separate channel.
Coding agents, long video, and benchmarks
- Coding harness: SWE-agent and OpenHands provide a shell, file system, code execution, long-range context, and a tool-calling loop. The authors state that this paper does not change the harness and only makes perception an ordinary command-line tool.
- Two routes for visual evidence: Video-LLaMA, LongVA, and T* sample or summarize a limited number of frames; VGGT and Depth Anything 3 perform explicit 3D reconstruction. The authors state that both treat the output as fixed context, and cross-view association and metric comparison still rely on implicit reasoning.
- Benchmark shift: Evaluation moves from single-image probing in BLINK and EmbSpatial to MMSI-Bench, MindCube, and SPAR-Bench, as well as VSI-Bench, ReVSI, and MMSI-Video-Bench.
Baselines and benchmarks: The experimental baselines are divided into proprietary VLMs (such as GPT-5.4, Grok 4, and the Gemini series), open-source general and spatial-specialized models (the Qwen series, the SenseNova-SI series, etc.), and the agent systems S-Agent and SpatialClaw; Table 3 also lists pySpatial and SpaceTools. Evaluation uses MMSI-Bench, MindCube, SPAR-Bench, ReVSI, and MMSI-Video-Bench. The authors state that this paper does not write a controller; design effort goes into the interface: model perception and tool measurement enter the same scene, readings stay in scene memory by name, and are returned in spatial language.
How does the paper address this problem?
S-Agent 2.0 keeps the general coding agent unchanged, and uses command-line tools to accomplish collection, memory, and spatial language interpretation.
S-Agent 2.0 treats an off-the-shelf general coding agent as the planner and executor, and places the design in command-line perception tools, used to close the evidence loop: acquire, remember, interpret on arrival. The system has three parts: a policy π, a toolset T, and a per-question persistent scene memory S. A fixed instruction u is the same for every question and contains tool tutorials and a suggested workflow: decide on evidence E, acquire it with tools, check the perception output, and answer according to the readings.
Problem setting and action space
- Input: A spatial question consists of a question q and a frame set I. The context at step t contains u, q, and the preceding thoughts, actions, and tool replies; π produces the next step from this until an answer is submitted.
- Two kinds of actions: Both go through the CLI. Agen are the coding agent's original actions, such as Linux commands, writing and running code, and reading files and images. Aperc are perception actions, such as reconstruction, segmentation, and spatial relation readings.
- Context and disk: A perception action returns the full output m and a reply. The reply enters the context; m and the original frames stay on disk, and the model uses the read-file action to decide when to read which one, and what is read then enters the context.
- The mapping the model is responsible for: The authors state that the model does two things: decide from q what evidence is needed, and read each reply as part of that evidence. The authors state that it therefore relies only on the CLI that every coding agent has, and the harness can be swapped (§3.3).
Scene memory kept by the environment
The authors do not let the context window transcribe and carry all intermediate results. Scene memory is S=(I, P, {(νi, gi)}i): I is the original frames, P is the fused metric point cloud in a gravity-aligned world frame; each instance has a name usable in later calls, and geometry, including 3D position, the extent of the point set belonging to that instance, and an SE(3) six-degree-of-freedom pose, the latter two may be empty. Both tools and the model can write. Relation measurement becomes a closed-form query over the stored geometry, covering single-instance size and height, as well as distance, relative direction, and inter-frame motion. Each reading is recomputed from the stored geometry, and the model only needs to remember instance names.
Two writes split by capability
- The boundary: The authors state that deciding what to measure is semantic work that VLMs are good at, while precise masks and measurements are better done by specialized perception models. A perception action is a command plus parameters given by the model; the model can write a previous reply directly as the next parameter.
- Tool perception: recon builds a metric, gravity-aligned scene over all frames and registers each camera. Depth and pose use Depth Anything 3, gravity uses GeoCalib, and the per-pixel motion mask uses the models cited in [37, 54]. segment uses SAM 3, with the model's own text as the prompt, and can specify a frame or all frames; regions with the same label are merged within 0.75 m and marked static or moving according to the motion mask. When two views have almost no co-visible surface, the reply carries overlap_warning.
- Model perception: add_instance lets the model name an instance, which can be an object it recognizes or an observer imagined by the question. The position comes from a top-down image pixel, an original image pixel, or a camera; the orientation comes from a primary axis plus an orthogonalized secondary direction, or faces an existing instance. A repeated call with the same name that gives only orientation changes the orientation in place. drop deletes an instance the tool registered wrongly, such as a mask on a reflection, so that memory can be corrected before taking readings.
- The same geometry: The authors state that thereafter the tools measure instances registered by the model the same as tool instances, so that constructs existing only in the reading of the question and instances grounded by tools lie in the same geometry.
The language surface that interprets on arrival
The authors state that a displacement vector by itself does not say from which object it is measured, whether the axis is gravity or camera, or which option it favors. Earlier tool systems returned bare numbers or arrays, and the model completed the step from number to spatial statement. In this paper each command condenses m against S into operc=cτ(m;S): several numeric fields with units, plus a one-sentence conclusion. The conclusion names the entity, declares the coordinate frame (gravity-aligned, camera, or image plane), and writes in the spatial words commonly used in answers. The full geometry remains in m on disk and can be read again through the same CLI when needed. Scale defaults to the reconstruction's own metric scale; distance and depth can be calibrated with a known distance, and the units field in the reply states whether calibration has been done.
Command surface and what is not changed
- Commands taught: Appendix B groups them into tool perception, model perception, and readings, including recon, segment, add_instance, drop, list_instance, bev, distance, depth, side, elevation, motion, compass. bev gives a top-down view in the camera's ground frame; compass can anchor a direction as a bearing and serve later queries.
- Commands not used: The executable also has lower-level commands such as detect, measure, and match, which the instructions tell the agent not to use. Appendix C states that these kept commands account for less than 2% of all calls.
- No training, no loop changes: The default harness is OpenHands; the same workspace and tools also run under Codex and Claude Code. The paper does not give the sampling temperature or maximum number of steps in the method section.
What experiments did the paper conduct?
The Qwen3.8-27B version scores 66.5 on MMSI and 82.3 on ReVSI; the Gemini-3.8-Flash version scores 74.1 and 90.5.
Experimental setup
- Backbone and harness: The main backbone is Qwen3.8-27B (FP8, locally served); capability comparisons use Gemini-3.8-Flash. The default harness is OpenHands, with Codex and Claude Code also used (§3.3).
- Perception backends: All frozen. Depth Anything 3 performs metric reconstruction, GeoCalib estimates gravity, SAM 3 performs promptable segmentation, and the per-pixel motion mask uses the models cited in [37, 54].
- Five benchmarks: MMSI-Bench tests positional relations, geometric attributes, motion, and multi-step reasoning across multiple images of the same scene; MindCube asks about relations not directly given by a few sparse views; SPAR-Bench ranges from basic metric perception to multi-view relations and is used for harness substitution; ReVSI evaluates 3D relations that are unreliable from a single frame under dynamic observation; MMSI-Video-Bench extends MMSI to long video, including spatial construction, motion, cross-video memory, and route planning. The usage statistics in Appendix C are counted as 1000 questions each for MMSI-Bench and ReVSI. The paper does not state the number of questions for the other three benchmarks.
- Metrics and protocol: ReVSI and SPAR-Bench follow the official protocol and macro-average by question type; the rest report overall accuracy. For ReVSI's object counting, absolute distance, object size, and room size, the official mean relative accuracy is used; the rest are multiple-choice. The paper does not state the judge model or report the number of repetitions.
- Baselines: Proprietary VLMs, open-source general and spatial-specialized models, and S-Agent and SpatialClaw. Table 3 additionally compares pySpatial and SpaceTools on Qwen3.8-27B. The paper does not state item by item whether the proprietary model scores in the table were rerun for this work.
- Frame settings: In Table 2, S-Agent 2.0, Qwen3.8-27B, Gemini 3.8 Flash, GPT-6, etc. use 64 frames; other rows in the same table have 1 FPS, 128, 4 FPS, 32, 16. The table cannot be read as a single frame-sampling protocol.
Main results
The table below gives overall scores. MMSI, MindCube, SPAR, and MMSI-Vid are from Table 1 and Table 3; ReVSI is from Table 2. Parentheses in the original are the change relative to SpatialClaw on the same backbone and are not repeated in the table. The Gemini version's MindCube, SPAR, and MMSI-Vid are not reported in these tables in the paper.
Swipe horizontally to read the table
System (backbone) MMSI ReVSI MindCube SPAR MMSI-Vid S-Agent 2.0 (Qwen3.8-27B) 66.5 82.3 88.3 72.4 56.4 SpatialClaw (Qwen3.8-27B) 62.6 74.5 83.2 70.2 53.1 S-Agent (Qwen3.8-27B) 48.3 59.5 75.5 63.0 37.9 S-Agent 2.0 (Gemini-3.8-Flash) 74.1 90.5 not reported not reported not reported SpatialClaw (Gemini-3.8-Flash) 67.0 79.7 not reported not reported not reported Qwen3.8-27B (single model in table) 50.4 61.3 not reported not reported not reported Gemini 3.8 Flash (single model in table) 60.0 77.0 not reported not reported not reported GPT-6 71.0 84.2 not reported not reported not reported - The authors' statement about averages: The authors state that at 27B and without training, the MMSI average is higher than the proprietary models in the table except GPT-6, and higher than all agent baselines; the Gemini-3.8-Flash version has the highest average in Table 1 and Table 2. GPT-6's R-R on MMSI is 72.8, Cam. is 89.2, and MSR is 75.3, still higher than the Gemini version's 67.9, 82.4, and 71.2.
- ReVSI question types: The authors state that relative to specialized baselines, the largest gaps are in relative direction and route planning, which require cross-object geometry, and that absolute distance is a gap and also the question type where GPT-6 trails the most. In Table 2 the Gemini version's object size is 86.1 (−0.5), so absolute distance is not the only negative; the Qwen version's absolute distance is 76.7 (−2.8), and the Gemini version's is 88.2 (−1.7).
- MMSI is not higher in every category: Relative to SpatialClaw on the same backbone, the Qwen version's C-R is 74.7 (−4.8) and Cam. is 75.7 (−1.3). Figure 1 states that it is higher than SpatialClaw on all tested benchmarks and backbones; the scores on the other three benchmarks for the Gemini version are not reported in the main-text tables.
With and without tools, and stronger backbones
- Same coding agent: In Table 5, Qwen3.8-27B without tools is ReVSI 61.8 and MMSI 52.6, and with tools is 82.3 and 66.5. Gemini-3.8-Flash without tools is 80.9 and 62.9, and with tools is 90.5 and 74.1. The abstract writes these two gains as +13.9 and +20.5 for Qwen, and +11.2 and +9.6 for Gemini, in the order MMSI, ReVSI.
- SpatialClaw counterpart: Qwen without tools is 61.3 and 50.4, and with tools is 74.5 and 62.6; Gemini without tools is 77.0 and 60.0, and with tools is 79.7 and 67.0. These no-tool MMSI scores are the same as the single-model rows in Table 1 and differ from the no-tool scores of the coding agent in the previous row.
- The authors' comparison: The authors state that scores with tools rise as the backbone gets stronger, and that SpatialClaw is lower than this paper on every backbone and benchmark in that table. The authors state that on ReVSI SpatialClaw's tool gain shrinks from +13.2 to +2.7, while this paper's remains +9.6.
Interface ablation
- Removing one item at a time: Table 6, Qwen3.8-27B. The full system is MMSI 66.5 and ReVSI 82.3; without scene memory 63.0 and 79.8; without interpretable readings 65.2 and 81.1; without the model perception interface 57.7 and 76.4.
- The drops given by the authors: Removing interpretable readings is −1.3 and −1.2; removing scene memory is −3.5 and −2.5; removing the model perception interface is −8.8 and −5.9. The authors state that removing each item lowers accuracy, and the ordering is consistent with the diagnosis in §1.
- The authors' statement about the closed loop: The authors state that on the surface only the interpretation is wrong, but underneath the collected evidence is not fully used; closing the loop requires interpretable design and also scene memory. The largest drop in the table is the model perception interface.
Qualitative analysis and harness substitution
- Three harnesses: Table 4, all with Qwen3.8-27B as backbone. MMSI-Bench: OpenHands 66.5, Codex 67.0, Claude Code 63.8. SPAR-Bench: 72.4, 71.8, 72.8. ReVSI: 82.3, 76.6, 79.1. The authors state that it works under each.
- Trajectories versus SpatialClaw: §3.4 states that on the same backbone and the same perception backend, the baseline still does not close the loop after obtaining the correct mask and position: it states the right-hand rule correctly but implements it in reverse, or first obtains the correct direction and then overturns it after looking at the image. The authors state that this paper writes the problem premise as an oriented instance or a compass anchor, and relations are returned in the words used by the options. In Figure 4, both sides on the left are gemini-3.8-flash.
- Remaining errors: The authors state that the remaining errors occur when the question enters measurement, in two categories: an imagined viewpoint borrows another orientation; and when asked for an object's own height, it reads the height above ground (Figure 4, bottom right). Appendix E has six more questions, both sides also gemini-3.8-flash, where SpatialClaw answers incorrectly and this paper answers correctly.
Other ablations and analyses
- Appendix D / Table 9, Qwen3.8-27B: SpatialClaw is ReVSI 74.5 and MMSI 62.6; after porting distance, depth, side, elevation, motion, and compass it is 75.5 and 62.9; S-Agent 2.0 is 82.3 and 66.5. The main text does not give a separate concluding sentence for this table.
- Table 3, Qwen3.8-27B, in the order MMSI, MindCube, SPAR, MMSI-Vid, ReVSI: pySpatial is 36.3, 66.3, 42.1, 26.9, 39.3; SpaceTools is 43.2, 58.6, 55.3, 39.3, 64.4.
- In Table 1 the earlier S-Agent (Qwen3.8-27B) has an MMSI average of 48.3, lower than the 50.4 of the single Qwen3.8-27B model in the same table; in Table 2 its ReVSI is 59.5, lower than 61.3. The paper does not explain this.
- Appendix C: recon, segment, and bev appear in more than 90% of episodes in every full-benchmark run. The model perception interface accounts for about one quarter to one half of episodes, and drop for about one fifth to two fifths. In Qwen's MMSI runs add_instance is 36% and drop is 26%; in Gemini's ReVSI runs they are 48% and 40%.
- Appendix C: MMSI more often calls side, motion, and compass; ReVSI more often calls distance and list_instance. The lower-level commands kept by the instructions account for less than 2% of all calls.
What are some points that can be further explored?
The paper does not write limitations and future directions in the limitations or conclusion.
Limitations and future directions pointed out by the authors
The paper does not specifically discuss limitations. The conclusion (§4) reports results relative to the agent baseline, the in-table position of the Gemini-3.8-Flash version on MMSI-Bench and ReVSI, and that the tools can be swapped across harnesses, without writing them as limitations or future work. Introduction Takeaway 3 and §3.4 describe the remaining errors as lying in connecting the question to measurement, but not in the framing of limitations or future directions.
Experimental coverage
- The evaluation benchmarks are MMSI-Bench, MindCube, SPAR-Bench, ReVSI, MMSI-Video-Bench (§3.1). Table 3 has scores for all five on Qwen3.8-27B.
- The backbones the authors wrote and ran are Qwen3.8-27B (FP8, local) and Gemini-3.8-Flash. The Gemini version's scores in Table 1, Table 2, Table 5 are for MMSI-Bench and ReVSI.
- Harness replacement covers OpenHands, Codex, Claude Code, with Qwen3.8-27B as the backbone and MMSI-Bench, SPAR-Bench, ReVSI as the benchmarks (Table 4).
- With and without tools is in Table 5; ablations of scene memory, interpretable readings, and the model perception interface are in Table 6; reading porting is in Appendix D and Table 9. Qualitative examples and Appendix E use gemini-3.8-flash, with the same perception backend on both sides. The perception model is frozen in §3.1.
- The paper does not report the number of repeats, variance, or agreement with human judgment. The paper does not state the number of questions for MindCube, SPAR-Bench, MMSI-Video-Bench; Appendix C says MMSI-Bench and ReVSI each have 1000 questions.
Summarize the main content of the paper
S-Agent 2.0 uses a general coding agent and perception tools to close the loop on spatial evidence, and reports results on five benchmarks.
S-Agent 2.0 is a spatial reasoning system attached to a general coding agent, handling 3D position, relations, and motion in multi-view and video.
- The gap to fill: The authors believe specialized agents spend design effort on richer perception and geometry libraries for acquisition, while memory and interpretation are still left to the model. Common failures in trajectories are using the wrong sign or coordinate frame for a reading, and measurements already in the workspace while the answer instead relies on looking at the image.
- Approach: The loop of OpenHands, Codex, or Claude Code is not changed; only command-line tools are added. Reconstruction and segmentation write into a gravity-aligned scene memory; the model can use add_instance and drop to put self-recognized instances into the same geometry, or delete wrong registrations. distance, side, motion, compass, etc. return unit-bearing numbers by name plus a one-sentence spatial-language conclusion. The backbone is not trained.
- Five benchmarks: On Qwen3.8-27B, MMSI-Bench 66.5, ReVSI 82.3, MindCube 88.3, SPAR-Bench 72.4, MMSI-Video-Bench 56.4 (Table 1–3), higher than SpatialClaw on the same backbone at 62.6, 74.5, 83.2, 70.2, 53.1. On Gemini-3.8-Flash, MMSI-Bench 74.1 and ReVSI 90.5. The authors state that these two averages are higher than the compared models in the table, including GPT-6; the 27B version on MMSI is still lower than GPT-6's 71.0.
- Tools and interface: Relative to the same coding agent without tools, the abstract writes MMSI +13.9 and ReVSI +20.5 for Qwen3.8-27B, and +11.2 and +9.6 for Gemini-3.8-Flash. The authors state that as the backbone gets stronger both gains shrink, but SpatialClaw on ReVSI shrinks from +13.2 to +2.7 while this paper's remains +9.6. In Table 6, removing the model perception interface causes a larger drop than removing scene memory or interpretable readings.
- The authors' conclusion: At 27B and without training, it is higher than the compared agent baselines on all five benchmarks; tool gains remain substantial on stronger backbones; the same tools can be swapped across coding harnesses. The authors place the remaining errors in connecting the question to a measurement, including imagined viewpoints and measuring the wrong quantity (§3.4).