Skip to content

fix(analyst): let analyst read workspace memory and steer it to workspace skills - #1570

Open
hkaltai wants to merge 9 commits into
mainfrom
fix/analyst-workspace-memory-skills
Open

hkaltai wants to merge 9 commits into
mainfrom
fix/analyst-workspace-memory-skills

Conversation

@hkaltai

@hkaltai hkaltai commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #1569

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

In a linked project, analyst could not answer read-only questions like "what are our conventions?": every memory tool was denied, the identity section named a save tool it lacked, and every reply had to go through answer_commit.

  • Analyst may now read, reload and audit workspace memory. Write, delete and extract stay denied; data-explorer is unchanged. A reload syncs like every session's first load (it can drop a local copy of a block the workspace archived) but cannot create or edit memory.
  • The team-memory line names only the memory tools this agent and request keep. The line and tool removal share one rule, LLM.removedTools (agent permission plus tools switched off on the request). Full access keeps today's text; read-only points at the read tool; write-only drops the read-first hint; neither gets no line.
  • The analyst prompt loads a matching skill by the listing's source precedence (workspace and project skills included), answers convention questions in plain text, and still finishes data questions through answer_commit.
  • An empty memory read no longer suggests the write tool, for any agent.
  • Docs: both analyst pages (agent modes and the agents reference) list the new memory, audit-log and skill access.

Small extras beyond the issue: the write-only case is reachable only through user config, and the docs lines.

Before and after

Area Before After
Analyst memory tools All denied (read, reload, audit, write, delete, extract) Read, reload and audit allowed; write, delete and extract still denied
Team-memory line in the identity section Named a save tool analyst could not use Names only the memory tools the agent and request keep (none, read-only, write-only or full)
Empty memory read Suggested the write tool to every agent No write-tool suggestion
Skill choice in the analyst prompt No steer toward workspace or project skills Loads a matching skill by the listing's source precedence, workspace and project skills included
Convention questions ("what are our conventions?") Forced through answer_commit, often with no useful answer Answered in plain text
Data questions Finish through answer_commit Unchanged, still finish through answer_commit
data-explorer agent Memory tools denied Unchanged
Docs Analyst pages did not mention memory or skills Agent modes page and agents reference list the new access, including the local audit log and what a reload changes

Follow-ups (existing behaviour, not changed here)

The issues below came up in review. Each was reported in the issue tracker as a separate bug for follow-up, and neither is fixed in this PR.

# Issue Affects Suggested fix Review thread
1 altimate_memory_audit reads only this checkout's local audit log. It does not show changes teammates made directly in workspace memory. Every agent allowed the tool (builder before this PR, analyst too now) Add a workspace-wide audit source, or rename the tool and describe it as a local log r4325949555
2 With tool retrieval on (ALTIMATE_TOOL_RETRIEVAL=1, off by default), retrieval can drop a memory tool after the team-memory line has named it. Before this PR the line named both tools for every agent. Every agent with memory tools, only when retrieval is on Build the line from the tool set left after retrieval, or always keep the named memory tools in retrieval r4325949572
3 A user config granting "*" or altimate_memory_write turns memory write, delete and extract back on for analyst, the same way it already turns on edit, write and sql_execute_write. Only bash is denied again after user config. Analyst, only with such a user config Deny the write tools again after user config, as bash is, or limit analyst to an allow-list consensus review
4 Analyst's "*": "deny" overrides the default external_directory allow for skill directories, so analyst can't read files bundled with global skills stored outside the project. Workspace skills are unaffected. Analyst Add the skill-directory allows back, as Truncate.GLOB already is consensus review

How did you verify your code works?

  • Tests: analyst permission matrix, all four read/write cases of the identity line, a cached outcome rendered per agent, the shared removal rule, and a prompt-loop test tying the identity section to the tools sent to the model.
  • Reverting each fix makes its new test fail.
  • Typecheck clean; affected suites pass.
  • Not done: a live analyst run against a linked workspace (provider returned 402), so the prompt's effect on model choices is checked only at the unit level.

Cost side effects

None. About 110 more tokens in the analyst system prompt and three more tool definitions. No new model calls, queries or resources that grow with user data.

Screenshots / recordings

N/A, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Analyst agents can read, refresh, and audit workspace memory, but cannot save or delete it. Refreshing may remove local copies of memory archived in the workspace.
    • Analysts can use relevant workspace and project skills to answer questions about team conventions, standards, and past decisions.
    • Workspace guidance reflects the memory tools available to each agent.
    • Empty memory searches now return a concise message without suggesting that read-only agents save memory.
  • Documentation
    • Updated Analyst capability and configuration documentation.

…pace skills

In a linked project the read-only analyst agent could not call any memory
tool, yet the workspace identity section told it to save with
`altimate_memory_write` and check `altimate_memory_read`. Its prompt named
only the built-in data skills and required every reply to finish through
`answer_commit`, which suits data values, not a list of conventions.

- analyst may call `altimate_memory_read`, `altimate_memory_refresh` and
  `altimate_memory_audit`; write, delete and extract stay denied, and
  data-explorer is unchanged.
- The team-memory line names only the memory tools the session's agent can
  call: a read-only agent is pointed at the read tool and told that builder
  saves; an agent with neither gets no line.
- The analyst prompt loads a matching skill by source precedence, answers
  questions about team conventions in plain text from skills and memory,
  and keeps `answer_commit` for data questions.

Fixes #1569

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26178c43-4674-4325-8315-909e1f1fd7b6
📥 Commits

Reviewing files that changed from the base of the PR and between 212ff7b and ecfba20.

📒 Files selected for processing: 4
  • packages/opencode/src/altimate/prompts/analyst.txt
  • packages/opencode/src/altimate/workspace/identity.ts
  • packages/opencode/src/memory/tools/memory-refresh.ts
  • packages/opencode/test/altimate/workspace/identity.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The Analyst can read, refresh, and audit workspace memory while memory saving and deletion remain unavailable. Its prompt covers workspace and project skills and plain-text replies to non-data questions. Workspace identity guidance reflects each agent’s available memory tools.

Changes: Analyst workspace knowledge

Layer / File(s) Summary
Analyst permissions and response rules
packages/opencode/src/agent/agent.ts, packages/opencode/src/altimate/prompts/analyst.txt, docs/docs/configure/agents.md, docs/docs/data-engineering/agent-modes.md, packages/opencode/test/agent/analyst-data-explorer.test.ts, packages/opencode/test/altimate/sql-validation-e2e.test.ts, packages/opencode/test/skill/skill.test.ts, packages/opencode/src/memory/tools/memory-read.ts, packages/opencode/src/memory/tools/memory-refresh.ts, packages/opencode/test/memory/overlay-merge.test.ts
The Analyst gains memory read, refresh, and audit permissions. Its prompt covers workspace skills and plain-text replies to non-data questions. Data questions retain answer_commit rules. The memory refresh description documents archived-block removal and no memory edits; empty reads no longer direct agents to save memory. Documentation and tests cover these changes.
Resolve effective memory-tool access
packages/opencode/src/session/llm.ts, packages/opencode/src/session/prompt.ts, packages/opencode/test/session/llm.test.ts, packages/opencode/test/session/prompt.test.ts
LLM.removedTools centralizes user and agent tool filtering. Session prompt generation uses the resulting memory-tool availability when rendering workspace identity. Tests compare the reported availability with the tools retained for the LLM call.
Render capability-specific memory guidance
packages/opencode/src/altimate/workspace/identity.ts, packages/opencode/test/altimate/workspace/identity.test.ts, packages/opencode/test/altimate/workspace/identity-section.test.ts
Workspace identity text reflects available memory read/write tools. It omits memory guidance for stale or unconfirmed bindings and when neither tool is available. Tests cover access combinations and memoized rendering.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant SessionPrompt
  participant LLM
  participant WorkspaceIdentity
  participant Analyst
  participant MemoryRead
  SessionPrompt->>LLM: Identify tools disabled by configuration or permissions
  SessionPrompt->>WorkspaceIdentity: Pass available memory read/write capabilities
  WorkspaceIdentity-->>SessionPrompt: Return capability-specific memory guidance
  SessionPrompt-->>Analyst: Provide prompt and retained tools
  Analyst->>MemoryRead: Read workspace memory
Loading

Suggested reviewers: anandgupta42

Merge Risk: ⚪ Minimal · up to ecfba

The analyst’s new memory and skill guidance is consistent with the documented contracts, with no actionable merge-blocking risk established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 14 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: enabling Analyst to read workspace memory and use workspace skills.
Description check Passed The description includes all required sections, explains the issue and implementation, documents verification and limitations, addresses cost side effects, and completes the checklist.
Linked Issues check Passed Issue #1569 requirements are met. analyst allows altimate_memory_read, altimate_memory_refresh, and altimate_memory_audit. Memory write, delete, and extract remain denied, and data-explorer …
Out of Scope Changes check Passed The changes stay within Issue #1569. The empty-memory response removes guidance to an unavailable write tool. Shared LLM.removedTools logic keeps identity text aligned with retained tools. The docum…
Full details: Linked Issues check

Explanation

Issue #1569 requirements are met. analyst allows altimate_memory_read, altimate_memory_refresh, and altimate_memory_audit. Memory write, delete, and extract remain denied, and data-explorer remains unchanged. The identity line uses the memory tools retained for the current agent and request. The analyst prompt loads matching workspace or project skills, answers non-data questions in plain text, and keeps answer_commit for data questions. Tests cover permissions, identity text, prompt behavior, and tool filtering.

Full details: Out of Scope Changes check

Explanation

The changes stay within Issue #1569. The empty-memory response removes guidance to an unavailable write tool. Shared LLM.removedTools logic keeps identity text aligned with retained tools. The documentation updates describe the requested analyst access. Tests support the implementation. The listed audit-log and retrieval follow-ups are explicitly not changed and do not establish unrelated scope.

Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 14 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit reads the workspace lore,
And finds the skills beside the door.
It checks the memory, block by block,
While Builder keeps the writing lock.
For data, answers follow their flow,
For team conventions, plain words grow.
The rabbit nods: “Now off we go!”

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

…tool

analyst can now call `altimate_memory_read` but not `altimate_memory_write`.
An empty read told it to "Use altimate_memory_write to save information",
steering a read-only agent toward a call it cannot make. The result now
only says that no blocks were found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

hkaltai and others added 4 commits October 20, 2026 16:08
…ization rule

The analyst prompt now limits answer_commit to data questions and lets
workspace-knowledge answers finish in plain text; update the pinned
finalization assertion and pin the new exclusion sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Share one removal rule (`LLM.removedTools`) between tool resolution and
  the workspace identity section, so a memory tool switched off on the
  request, or not registered, is not named in the prompt.
- A write-only agent gets the save line without the read-first step.
- The analyst prompt checks `altimate_memory_read` only when it has it.
- Update the analyst prompt assertion in sql-validation-e2e to the new
  finalization wording.
- Cover all four read/write combinations and one cached outcome rendered
  for different agents.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… wiring

- The analyst permission comment now says a reload syncs like the load
  every session runs and can drop a local copy of an archived block,
  rather than calling it read-only.
- The prompt comment scopes the memory line to the tools the agent and
  request keep; tool-free steps withhold every tool the prompt names.
- A prompt-loop test checks that the identity section is given the same
  memory access the tools handed to the model call imply.
- Document analyst's memory and workspace-skill access.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

Match the agent-modes page, and name the prompt-loop memory tests by
what they check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hkaltai
hkaltai marked this pull request as ready for review October 20, 2026 14:03
@kilo-code-bot

kilo-code-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (17 files)
  • docs/docs/configure/agents.md
  • docs/docs/data-engineering/agent-modes.md
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/altimate/prompts/analyst.txt
  • packages/opencode/src/altimate/workspace/identity.ts
  • packages/opencode/src/memory/tools/memory-read.ts
  • packages/opencode/src/memory/tools/memory-refresh.ts
  • packages/opencode/src/session/llm.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/agent/analyst-data-explorer.test.ts
  • packages/opencode/test/altimate/sql-validation-e2e.test.ts
  • packages/opencode/test/altimate/workspace/identity-section.test.ts
  • packages/opencode/test/altimate/workspace/identity.test.ts
  • packages/opencode/test/memory/overlay-merge.test.ts
  • packages/opencode/test/session/llm.test.ts
  • packages/opencode/test/session/prompt.test.ts
  • packages/opencode/test/skill/skill.test.ts
Previous Review Summaries (2 snapshots, latest commit 212ff7b)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 212ff7b)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (16 files)
  • docs/docs/configure/agents.md
  • docs/docs/data-engineering/agent-modes.md
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/altimate/prompts/analyst.txt
  • packages/opencode/src/altimate/workspace/identity.ts
  • packages/opencode/src/memory/tools/memory-read.ts
  • packages/opencode/src/session/llm.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/agent/analyst-data-explorer.test.ts
  • packages/opencode/test/altimate/sql-validation-e2e.test.ts
  • packages/opencode/test/altimate/workspace/identity-section.test.ts
  • packages/opencode/test/altimate/workspace/identity.test.ts
  • packages/opencode/test/memory/overlay-merge.test.ts
  • packages/opencode/test/session/llm.test.ts
  • packages/opencode/test/session/prompt.test.ts
  • packages/opencode/test/skill/skill.test.ts

Previous review (commit fb215f8)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (16 files)
  • docs/docs/configure/agents.md
  • docs/docs/data-engineering/agent-modes.md
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/altimate/prompts/analyst.txt
  • packages/opencode/src/altimate/workspace/identity.ts
  • packages/opencode/src/memory/tools/memory-read.ts
  • packages/opencode/src/session/llm.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/agent/analyst-data-explorer.test.ts
  • packages/opencode/test/altimate/sql-validation-e2e.test.ts
  • packages/opencode/test/altimate/workspace/identity-section.test.ts
  • packages/opencode/test/altimate/workspace/identity.test.ts
  • packages/opencode/test/memory/overlay-merge.test.ts
  • packages/opencode/test/session/llm.test.ts
  • packages/opencode/test/session/prompt.test.ts
  • packages/opencode/test/skill/skill.test.ts

Reviewed by gemini-4-argon · Input: 77.1K · Output: 1.1K · Cached: 165.4K

Review guidance: REVIEW.md from base branch main (truncated)

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 16 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/test/session/prompt.test.ts">

<violation number="1" location="packages/opencode/test/session/prompt.test.ts:635">
P3: This test never checks the rendered memory text, because `systemSection` is mocked to return "". It only checks the flags passed in. Rename it to describe what it asserts, or add a no-access turn (both tools denied) so the loop covers the case the PR description lists.</violation>
</file>

<file name="packages/opencode/src/agent/agent.ts">

<violation number="1" location="packages/opencode/src/agent/agent.ts:343">
P2: `altimate_memory_audit` reads only this checkout's local `.log`, so it cannot show teammate changes made directly in workspace memory. Add a workspace-aware audit source before exposing it as workspace auditing.</violation>
</file>

<file name="packages/opencode/src/session/prompt.ts">

<violation number="1" location="packages/opencode/src/session/prompt.ts:1923">
P2: `tools` is only the pre-stream catalog: retrieval can still remove either memory tool, so this line can advertise an action the model cannot call. Derive these flags from the final tool set or ensure the named memory tools survive retrieval.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/opencode/src/agent/agent.ts
Comment thread packages/opencode/src/session/prompt.ts
Comment thread docs/docs/configure/agents.md Outdated
Comment thread packages/opencode/test/session/prompt.test.ts Outdated
Comment thread docs/docs/data-engineering/agent-modes.md Outdated
Add an analyst turn with no memory tools to the prompt-loop test and name
the test for what it asserts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@sahrizvi

Copy link
Copy Markdown
Collaborator

Multi-model consensus review

Verdict: approve, with minor follow-ups. No critical or major issues. Five independent reviewers converged in one round, all approving.

Read-only check. The three new analyst allows (altimate_memory_read, altimate_memory_refresh, altimate_memory_audit) are exact names inside analyst's "*": "deny" block. Write, delete and extract stay denied. Bash is still re-denied after user config. Delegation is still limited to data-explorer, whose allow-list cap strips every memory tool. Builder, plan, reviewer and data-explorer are unchanged. LLM.removedTools keeps the old resolveTools behaviour. With default config, no new write, edit or shell path is opened.

Minor

  1. Refresh is read-mostly, and the model is not told (src/memory/tools/memory-refresh.ts:15-24, src/agent/agent.ts:337-343)
    refresh → loadWorkspaceMemory → reapArchivedBlocks → MemoryStore.remove, which unlinks local block files, appends a DELETE line to the local audit log, emits telemetry and fires archiveBlock. archiveBlock normally finds no live record and does nothing. This is not new: WorkspaceMemory.hydrate runs the same load at the start of every session, analyst included (src/session/prompt.ts:1766). The tool just lets analyst repeat it on demand. Suggest adding a line to the tool description, e.g. "May remove local copies of blocks the workspace archived; never creates or edits memory."

  2. "You cannot save memory" contradicts analyst's training tools (src/altimate/prompts/analyst.txt:16, src/altimate/workspace/identity.ts:113-115)
    Analyst still has training_save/training_remove, and the same prompt says "offer to save it as a rule using training_save" (analyst.txt:21). Training entries are stored with MemoryStore.write/remove (src/altimate/training/store.ts:51,107,133), which mirror to the workspace. The blanket instruction may make analyst refuse a "remember this rule" request or send it to builder. It is also wrong if config grants altimate_memory_write. Suggest scoping it, e.g. "You cannot save memory blocks (altimate_memory_write); when asked to save a decision or convention, say the builder agent can. Corrections to your own behaviour still go through training_save."

  3. User config can still lift analyst's memory-write deny (existing gap) (src/agent/agent.ts:322-358, :640)
    With last-match-wins, a global permission: { "*": "allow" } or altimate_memory_write: "allow" re-enables altimate_memory_write/_delete/_extract for analyst, and the identity line then names the write tool. This PR did not introduce it: the same override already re-enables edit, write and sql_execute_write, and only bash is re-denied after user config. Consider appending the memory write denies to the existing post-config bash: "deny" hardening, or capping analyst to an allow-list as dataExplorerPermission does. Either can be a follow-up.

  4. Test gaps

    • A user config that grants "*" or altimate_memory_write to analyst (see 3). The existing "analyst denies all shell commands despite … config grants" test can serve as the model.
    • The identity line when the memory tools are absent from the catalog (memory feature off).
    • How the training_save instruction and the "cannot save" line interact.

Nits

  1. teamMemoryLine falls back to full access when memoryTools is omitted (identity.ts:119). That is right for backwards compatibility, but a future caller that forgets the argument silently gets the save line. Consider making the fallback explicit at the renderBody call site.
  2. The read-only line hard-codes "the builder agent can". That is wrong for a custom agent configured with read but not write, or when builder is disabled.
  3. Existing behaviour, follow-up only: analyst's "*": "deny" also overrides the default external_directory allow for skill directories (only Truncate.GLOB is re-added, agent.ts:643-654). Workspace skills sync into the project and work, but analyst cannot read the bundled files of global skills outside the project.

Done well

  • Exact-name allows, no wildcards. The test asserts Permission.disabled returns exactly the write set, and that data-explorer denies all six memory tools.
  • The shared removedTools rule plus the prompt-loop test keep the identity text in step with the tools sent to the model.
  • The full-access identity text is byte-identical, so builder output is unchanged. The memo stores the outcome rather than rendered text, so each agent renders correctly.
  • An empty memory read no longer points any agent at the write tool.

Multi-model consensus review (5 reviewers, 1 convergence round, unanimous).

@dev-punia-altimate

Copy link
Copy Markdown
Contributor

🤖 Code Review — OpenCodeReview (Gemini) — No Issues Found

No supported files changed.

… reload removes

Analyst keeps training_save for corrections to its own behavior, so the
read-only memory line now refers to workspace memory blocks only and no
longer names one specific agent. The refresh tool description says it can
remove local copies of archived blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@hkaltai

hkaltai commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Here's what happened to each item. The fixes are in ecfba20.

  1. Refresh description: fixed. The altimate_memory_refresh description now says: "May remove local copies of blocks the workspace has archived; never creates or edits memory."
  2. "You cannot save memory" vs training_save: fixed. This PR added that line. It now says analyst can't save workspace memory blocks, and analyst.txt adds that a correction to its own behavior is still saved with training_save. The line still doesn't name altimate_memory_write, so a read-only agent isn't pointed at a tool it can't call.
  3. User config can lift analyst's memory-write deny: agreed this already existed. The same override already turns on edit, write and sql_execute_write. I reported it as a follow-up bug and listed it as row 3 in the PR description's Follow-ups table. Not fixed here.
  4. Test gaps:
    • Config grant: belongs with the follow-up for item 3.
    • Memory tools absent from the catalog: already covered. The read=false, write=false case in identity.test.ts checks there's no team-memory line, and identity-section.test.ts checks the same through systemSection. The memory-off case (teamMemory: false) is covered too.
    • training_save vs. the no-save line: the new wording keeps the two instructions apart in the prompt text. No runtime path ties them together, so there's nothing beyond a string to assert.
  5. Implicit full-access fallback: kept on purpose. Callers without agent context, and builder's byte-identical output, depend on it. A test pins that the full-access text equals the default.
  6. Hard-coded "the builder agent can": fixed in the shared identity line. It now says "an agent with memory write access, such as builder", which holds for custom agents too. analyst.txt still names builder, since that prompt is only for analyst.
  7. Analyst can't read files bundled with global skills: agreed this already existed. Reported as a follow-up bug and listed as row 4 in the Follow-ups table.

Tests: 505 passed and 0 failed across the identity, analyst permission, prompt, LLM and memory suites. Typecheck is clean.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analyst agent cannot read workspace memory and is not steered to workspace skills

3 participants