OpenHands / OpenHands/extensions

[Feature]: Implement explicit "Operating Modes" (Architect, Builder, Maintainer) to prevent context collapse

Open
#385 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
148
Forks
90
Avg merge
1d 17h
Merged PRs (30d)
36

Description

Is there an existing feature request for this?
  • I have searched existing issues and feature requests, and this is not a duplicate.
Problem or Use Case

When using the agent for different types of tasks, it applies a generic, one-size-fits-all "mindset." As a developer, if I ask the agent to fix a minor bug in a legacy file, it will often attempt a massive, unprompted refactor because it doesn't know it should be in a conservative state. Conversely, if I ask it to design an architecture, it often jumps straight into writing premature code.

This lack of behavioral constraints leads to severe context collapse, wasted API tokens, and unnecessary regressions in production code.

Proposed Solution

I propose adding a feature that allows users to select an explicit "Operating Mode" before starting a task. These modes would inject specific behavioral constraints into the agent's system prompt.

Based on my research in building the Vibe Coding Essentials runtime, configuring the agent with 4 distinct modes drastically improves outcomes:

Architect Mode: No code generation. Optimized for system thinking, planning, and tradeoffs only.
Builder Mode (Default): Optimized for shipping fast. Allows some technical debt and ignores premature abstractions.
Maintainer Mode: Stability first. Forces surgical, minimal diffs. Refuses to add new dependencies or refactor unbroken code.
Economy Mode: Strict token discipline. Bypasses large codebase scans for simple, routine tasks to save costs.

Alternatives Considered

Currently, I have to manually type out these constraints ("don't refactor", "just give me the diff", "don't write code yet") in every single prompt. This is extremely tedious, error-prone, and the model frequently ignores these constraints if they aren't phrased perfectly as system-level instructions.

Priority / Severity

High - Significant impact on productivity

Estimated Scope

Medium - New feature with moderate complexity

Feature Area

Agent / AI behavior

Technical Implementation Ideas (Optional)
  1. Store the behavioral rules as standalone markdown templates (e.g., builder.md, maintainer.md).
  2. Add a persistent dropdown in the chat UI (perhaps next to the model selector) to choose the active mode.
  3. When the prompt is constructed and sent to the LLM, append the text of the selected mode to the system instructions.
  4. I have already battle-tested the specific system prompts for these modes in my repository, and I would be happy to contribute them directly to the OpenHands core prompts.
Additional Context

You can see the exact rules, failure patterns, and prompts I've developed for these modes in my open-source repository: Vibe Coding Essentials. I'd love to help bring this behavioral architecture natively into OpenHands!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the chat UI model selector and the prompt-construction path where system instructions are assembled. Review the proposed standalone templates, such as builder.md and maintainer.md, along with the existing agent behavior code. Done means users can select an operating mode and the selected mode's constraints are applied consistently to the agent instructions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.