Marco structured output nav in sight - #12
Conversation
Greptile SummaryThis PR revises native Gemini structured output and navigation-in-sight behavior, externalizes the vision system prompt, adds pose information to pre-action history, and changes retained image-history proportions.
Confidence Score: 3/5The PR should not merge until coordinate normalization and the structured Two changed execution boundaries can fail concretely: coordinate strings accepted by the input model now undergo unsupported arithmetic, and unrestricted structured-output strings are checked against a case-sensitive navigation enum only after generation. Files Needing Attention: src/agents/native_gemini_vision_agent.py, src/history/history.py, src/primitives/navigate_in_sight.py, README.md Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Robot image payload] --> B[Validate coordinate keys]
B --> C[Store pre-action image and pose]
C --> D[Build multimodal history]
B --> E[Build Gemini user context]
D --> E
F[system_prompt.md] --> G[Format system instruction]
H[Available primitives] --> I[Generate structured response schema]
E --> J[Gemini visual decision]
G --> J
I --> J
J --> K{Next primitive}
K -->|navigate_in_sight| L[Read spatial indicator and target]
L --> M[Select safe visual candidate]
M --> N[Convert to navigate_to_position]
K -->|Other primitive| O[Normal Brain task flow]
Reviews (1): Last reviewed commit: "WIP" | Re-trigger Greptile |
| theta_rad = coords.get('theta', 0.0) | ||
| theta_deg = theta_rad * 180.0 / math.pi # Convert radians to degrees | ||
| robot_coordinates = f"Your coordinates if useful to know are: x={coords.get('x')}, y={coords.get('y')}, z={coords.get('z')}, theta={theta_deg:.1f}° (degrees)" |
There was a problem hiding this comment.
Coordinate strings break processing
MultimodalVisionAgentInput.robot_coords permits string values, and image validation only checks that theta exists. A payload such as {"theta": "1.57"} therefore reaches this arithmetic and raises TypeError, preventing the visual decision from being assembled. Stored pre-action coordinates have the same problem because x, y, and theta are numerically formatted without normalization. Validate coordinates as finite numbers when they enter the system, or convert supported numeric strings before using them.
Knowledge Base Used:
| # Validate spatial_indicator | ||
| valid_spatial_indicators = ["Right of the", "Left of the", "front of the", "towards the", "under the"] | ||
| if spatial_indicator not in valid_spatial_indicators: | ||
| error_msg = f"Invalid spatial_indicator '{spatial_indicator}'. Must be one of: {', '.join(valid_spatial_indicators)}" | ||
| return error_msg, False, None |
There was a problem hiding this comment.
Schema permits rejected indicators
The generated structured-output schema treats spatial_indicator as an unrestricted string, but this code accepts only five case-sensitive spellings. A schema-valid response such as "Front of the" or "right of the" is therefore canceled instead of producing a navigation action. Encode the allowed values in the schema, or normalize casing consistently before validation.
Knowledge Base Used:
| return [ | ||
| { | ||
| "image_path": "nav_in_sight_front.jpeg", | ||
| "target_description": "front of the red bike", | ||
| "selected_point": 7, | ||
| "reasoning": "Point 7 is the best choice because it gets the robot on a good trajectory towards the front of the red bike without getting too close. It provides a clear path that avoids obstacles while positioning the robot to approach the bike from the front as requested." | ||
| } |
There was a problem hiding this comment.
This point-selection example is inserted without its referenced image, while point numbers are assigned anew from the safe candidates in each current scene. The claim that point 7 is best therefore has no visible relationship to the example target and can bias the model toward an arbitrary point in the current image. Include the annotated example image and its candidate layout, or remove the hard-coded point number.
Knowledge Base Used: Navigation strategies
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| ```bash | ||
| python run_server.py --enable-memory-commands | ||
| ``` | ||
| gcloud compute ssh --zone "us-central1-c" "benchmark-agent-instance" --project "innate-agent" --ssh-flag="-X" |
There was a problem hiding this comment.
Internal SSH command is unexplained
This command appears directly after the local memory-command example and hard-codes an internal project, zone, and instance. Contributors can mistake it for a required setup step even though it is unusable without access to that environment. Remove it or place it in a clearly labeled benchmark or deployment section with prerequisites and configurable placeholders.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.