Skip to content

feat(agent): let the assistant rename and merge section types - #84

Merged
Rl0007 merged 2 commits into
mainfrom
feat/agent-section-type-tools
Oct 6, 2026
Merged

Rl0007 merged 2 commits into
mainfrom
feat/agent-section-type-tools

Conversation

@Rl0007

@Rl0007 Rl0007 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
  1. The assistant could create section types but not rename, merge or delete them, so asking it to merge overlapping types left the old ones empty but still offered for new documents.
  2. It can now rename a type (sections keep it) and merge one type into another (sections move over, the old type is deleted; this is also how a type gets deleted). Both wait for your confirmation, and the confirm card names the types and how many sections are affected.

You can ask the assistant on any import's Review screen to see it.

Fixes #41

Verification
  • 5 new tests in test_agent_write.py (rename keeps sections; merge moves all sections and deletes the source; merging into itself, an unknown type or the catch-all type is refused; a non-System-Manager user is refused; the confirm card holds the merge and names both types and the count, then the approved run applies it): red on main (AttributeError), green on the branch. LLM call stubbed.
  • Full suite on a devbox: 490 run, 479 pass, 11 skipped, 0 failures (baseline 474/11 on 485).
  • Devbox e2e through the agent loop: two [test] types on 3 sections; unapproved rename/merge changed nothing and showed "Move 2 section(s) from Section Type 'test_e2e_alpha' to 'test_e2e_beta', then delete 'test_e2e_alpha'."; approved runs renamed, then moved all 3 sections to the target and deleted the source; data restored.
  • Merge goes through frappe.rename_doc(..., merge=True), so every link to the old type is repointed. The optional confirm_summary on Tool is the same field as in fix(agent): name the section in the delete confirm card #81.
  • frappe-reviewer: its findings are applied (use rename_doc, refresh the graph after a type change, more test cases).

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@Rl0007
Rl0007 merged commit 6e59ec9 into main Oct 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the assistant merge, rename and delete section types

1 participant