| layout | default |
|---|---|
| title | Chapter 2: Architecture and Workflow |
| nav_order | 2 |
| parent | Plandex Tutorial |
Welcome to Chapter 2: Architecture and Workflow. In this part of Plandex Tutorial: Large-Task AI Coding Agent Workflows, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.
Plandex combines planning, execution, and diff review to support long-horizon coding tasks.
- context loading and planning
- execution and tool/debug loop
- cumulative diff sandbox review
- iterative refinement and apply
You now understand Plandex's large-task lifecycle.
Next: Chapter 3: Context Management at Scale
The Scan function in app/shared/ai_models_data_models.go handles a key part of this chapter's functionality:
}
func (m *ModelRoleConfig) Scan(src interface{}) error {
if src == nil {
return nil
}
switch s := src.(type) {
case []byte:
return json.Unmarshal(s, m)
case string:
return json.Unmarshal([]byte(s), m)
default:
return fmt.Errorf("unsupported data type: %T", src)
}
}
func (m ModelRoleConfig) Value() (driver.Value, error) {
return json.Marshal(m)
}
type PlannerRoleConfig struct {
ModelRoleConfig
PlannerModelConfig
}
func (p *PlannerRoleConfig) Scan(src interface{}) error {
if src == nil {
return nil
}
switch s := src.(type) {
case []byte:
return json.Unmarshal(s, p)This function is important because it defines how Plandex Tutorial: Large-Task AI Coding Agent Workflows implements the patterns covered in this chapter.
The Value function in app/shared/ai_models_data_models.go handles a key part of this chapter's functionality:
}
v := reflect.ValueOf(*m)
t := v.Type()
for i := 0; i < v.NumField(); i++ {
f := t.Field(i)
if f.Name == "ModelId" { // skip the sentinel field
continue
}
fv := v.Field(i)
switch fv.Kind() {
case reflect.Pointer, reflect.Interface, reflect.Map, reflect.Slice:
if !fv.IsNil() {
return false
}
default:
if !fv.IsZero() {
return false
}
}
}
return true
}
func (m *ModelRoleConfigSchema) AllModelIds() []ModelId {
ids := []ModelId{}
if m.ModelId != "" {
ids = append(ids, m.ModelId)This function is important because it defines how Plandex Tutorial: Large-Task AI Coding Agent Workflows implements the patterns covered in this chapter.
The Scan function in app/shared/ai_models_data_models.go handles a key part of this chapter's functionality:
}
func (m *ModelRoleConfig) Scan(src interface{}) error {
if src == nil {
return nil
}
switch s := src.(type) {
case []byte:
return json.Unmarshal(s, m)
case string:
return json.Unmarshal([]byte(s), m)
default:
return fmt.Errorf("unsupported data type: %T", src)
}
}
func (m ModelRoleConfig) Value() (driver.Value, error) {
return json.Marshal(m)
}
type PlannerRoleConfig struct {
ModelRoleConfig
PlannerModelConfig
}
func (p *PlannerRoleConfig) Scan(src interface{}) error {
if src == nil {
return nil
}
switch s := src.(type) {
case []byte:
return json.Unmarshal(s, p)This function is important because it defines how Plandex Tutorial: Large-Task AI Coding Agent Workflows implements the patterns covered in this chapter.
The Value function in app/shared/ai_models_data_models.go handles a key part of this chapter's functionality:
}
v := reflect.ValueOf(*m)
t := v.Type()
for i := 0; i < v.NumField(); i++ {
f := t.Field(i)
if f.Name == "ModelId" { // skip the sentinel field
continue
}
fv := v.Field(i)
switch fv.Kind() {
case reflect.Pointer, reflect.Interface, reflect.Map, reflect.Slice:
if !fv.IsNil() {
return false
}
default:
if !fv.IsZero() {
return false
}
}
}
return true
}
func (m *ModelRoleConfigSchema) AllModelIds() []ModelId {
ids := []ModelId{}
if m.ModelId != "" {
ids = append(ids, m.ModelId)This function is important because it defines how Plandex Tutorial: Large-Task AI Coding Agent Workflows implements the patterns covered in this chapter.
flowchart TD
A[Scan]
B[Value]
C[Scan]
D[Value]
E[GetMaxConvoTokens]
A --> B
B --> C
C --> D
D --> E