# Jiva v0.3.44 — Worker Agent Improvements, Code Mode Enhancements & Sarvam-105B Support

**Release Date:** April 17, 2026

---

## Highlights

- **MCP servers in code mode** — opt in selected servers via `--mcp browser,postgres` or `codeMode:true` in config; context stays lean by default
- **Worker agent persistence** — Worker now keeps going through errors and multi-step tasks instead of stopping early
- **Smarter tool error recovery** — targeted corrections for schema errors, truncated output, and malformed tool names across both agents
- **Better large file handling in code mode** — skeleton-first approach with explicit line-count guidance for all file types
- **Sarvam AI first in setup** — `jiva setup` now lists Sarvam as the first provider option
- **Sarvam-105B large file fix** — detects and recovers from truncated XML tool calls in both code mode and general mode
- **Skills as first-class citizens** — standalone skills from `~/.claude/skills/` work without a persona, in both chat and code mode
- **Slash command skills** — type `/skill-name` in the REPL to invoke any installed skill (e.g. `/graphify`)
- **CLAUDE.md / AGENTS.md directive support** — Jiva now reads these files as workspace directives when `jiva-directive.md` is absent

---

## Worker Agent

### Persistence
- System prompt rewritten with strong persistence guarantees: *never stop until the subtask is fully solved*, errors are expected and recoverable
- Removed the "is the task complete?" completion check that fired every 8 tools and gave the model a premature exit opportunity

### Iteration Nudges
- **70% of iterations**: injects a "keep going" nudge to prevent the model from wrapping up too early
- **90% of iterations**: injects a wrap-up nudge to ensure a clean synthesis before hitting the limit

### Error Recovery
- **Schema validation errors** (e.g. missing `ref` in `playwright__browser_fill_form`): targeted message naming the missing property and advising a snapshot first, instead of triggering a model phase-switch
- **`edit_file` missing `new_string`**: names the exact missing parameter
- **Truncated tool content**: skeleton-first guidance, generalized for all file types (no longer HTML-specific)
- **Malformed tool names**: client-side repair for `<|channel|>` token pollution — silently fixes and re-executes without burning an iteration
- **Post-API try/catch**: unexpected exceptions in tool processing no longer crash the subtask; error is injected as a user message and the loop continues

### Duplicate Call Detection
- Replaced the permanent "never call same tool+args twice" block with a **sliding window of 3 consecutive identical calls**
- Model can legitimately re-read or re-query the same resource across different task phases without being blocked

### Empty Response Recovery
- Empty model responses (no content, no tool calls) now trigger up to 4 escalating nudges instead of silently exiting

---

## Code Mode (`--code`)

### Selective MCP server opt-in
Code mode now supports external MCP tools without loading all servers by default. Too many tools bloat the context window; this keeps it lean and explicit.

**Two ways to opt in:**

```bash
# Per-invocation: comma-separated server names
jiva chat --code --mcp browser
jiva chat --code --mcp browser,postgres

# Persistent: set codeMode:true on a server in your config
# "mcpServers": { "browser": { "command": "...", "codeMode": true } }
```

Both compose: `codeMode:true` servers are always present; `--mcp` adds extras for the current session. Active servers appear in the startup banner and in the agent's system prompt.

### Large File Handling
- Item 8 in CODING PRINCIPLES rewritten: defines "large" as >80 lines, adds a pre-write estimation step, and makes the skeleton-first approach mandatory for all file types (TypeScript, Python, HTML, CSS, JSON, etc.)
- Runtime truncation correction messages generalized — no longer HTML/JS specific

### Error Resilience
- Added error recovery instruction to PERSISTENCE AND COMPLETION section
- Added post-API try/catch wrapper: unexpected tool-processing exceptions inject a recovery message and continue the loop

---

## Sarvam-105B

- **XML tool call parsing** — sarvam-105b emits tool calls as XML in `message.content` rather than native `tool_calls`; Jiva now parses and executes them correctly in both code mode and general mode
- **Truncation recovery** — when a large file write is cut off mid-response (token limit), both `CodeAgent` and `WorkerAgent` detect the open `<tool_call>` tag, inject a skeleton-first correction, and continue — instead of outputting the partial JSON as a chat response

## Skills & Directives

- **Standalone skills** — skills installed at `~/.claude/skills/<name>/SKILL.md` are discovered automatically at startup (compatible with Claude's skill format) and surfaced in the system prompt for both chat and code mode
- **Slash command skills** — type `/<skill-name>` in the REPL (e.g. `/graphify`) to load a skill; the next message you send will have the skill's instructions prepended
- **CLAUDE.md / AGENTS.md** — Jiva now falls back to these files as workspace directives when `jiva-directive.md` is not present, in precedence order: `jiva-directive.md` → `CLAUDE.md` → `AGENTS.md` → `.jiva/directive.md`

## Setup

- Sarvam AI is now the first option in `jiva setup` provider selection

---

## Upgrade

```bash
npm install -g jiva-core@0.3.44
```
