You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(agency): Show item count and reversibility in confirmation dialog - #732
AgencyConfirmation now warns when an action is destructive or irreversible. Its footer displays separate conditional indicators for radius, destructive state, irreversible state, and affected-item count. The component sums finite item counts and shows the count only when the total exceeds one. Radius calculation skips missing and null values, maps unknown values to external, and returns no indicator when no action reports a radius.
Estimated code review effort:
Merge Risk: Low · up to 534ad
The dialog remains usable, but can understate action risks and affected-item totals. These bounded disclosure issues warrant correction or explicit owner acceptance before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes in the changeset: showing item count and reversibility in the agency confirmation dialog. The raw summary confirms the AgencyConfirmation component now shows a cou…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description links two screen recordings of the assistant agency confirmation dialog, one for a destructive batch action and one for an irreversible action. It also includes an AI-usage disclosure.…
Full details: Title check
Explanation
The title names the two main changes in the changeset: showing item count and reversibility in the agency confirmation dialog. The raw summary confirms the AgencyConfirmation component now shows a count indicator for finite item_count values and an irreversible indicator for reversibility. The title is specific, follows the conventional commit style, and is a single sentence. It omits the destructive indicator and radius logic, which is acceptable.
Full details: Description check
Explanation
The description links two screen recordings of the assistant agency confirmation dialog, one for a destructive batch action and one for an irreversible action. It also includes an AI-usage disclosure. The changeset adds destructive and irreversible warnings, item count, and radius indicators to AgencyConfirmation.vue, so the description relates to the changes and is not off-topic.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
Error: typescript-eslint does not support TS 7.0.
at Object. (/.eslint-tmp/node_modules/typescript-eslint/dist/index.js:52:11)
at Module._compile (node:internal/modules/cjs/loader:1929:14)
at Object..js (node:internal/modules/cjs/loader:2060:10)
at Module.load (node:internal/modules/cjs/loader:1651:32)
at Module._load (node:internal/modules/cjs/loader:1443:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:372:15)
at ModuleWrap. (node:internal/modules/esm/translators:244:9)
at ModuleJob.run (node:internal/modules/esm/module_job:561:25)
at async node:internal/modules/esm/loader:647:26
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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 8b21bab9-a6b0-486e-beb0-bfacafa2cbe0
Commits
Reviewing files that changed from the base of the PR and between 9e9a064 and 534adfb.
Files selected for processing: 1
src/components/ChattyLLM/AgencyConfirmation.vue
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '1,275p' src/components/ChattyLLM/AgencyConfirmation.vue
sed -n '1,85p' src/components/ChattyLLM/AgencyAction.vue
git diff 9e9a064a37de8ef5a55711e821a7ce0b11f34ea7 534adfbb0fbc50b966d035507f03ac5e423d6b39 -- src/components/ChattyLLM/AgencyConfirmation.vue
Repository: nextcloud/assistant
Length of output: 16132
Show the warning descriptions without hover.
Touch and keyboard users may not see the destructive or irreversible descriptions. The icon-only buttons also add tab stops that do nothing. Show the descriptions as text and use non-interactive indicators.
nl -ba lib/Controller/ChattyLLMController.php | sed -n '155,215p'
nl -ba lib/Listener/ChattyLLMTaskListener.php | sed -n '110,185p'
nl -ba src/components/ChattyLLM/AgencyAction.vue | sed -n '1,220p'
nl -ba src/components/ChattyLLM/ChattyLLMInputForm.vue | sed -n '1620,1685p'
python3 - <<'PY'import json, urllib.requesturl = 'https://api.github.com/repos/nextcloud/context_agent/git/trees/2.8.0?recursive=1'try: with urllib.request.urlopen(urllib.request.Request(url, headers={'User-Agent':'evidence-inspection'}), timeout=20) as r: data = json.load(r) print('TREE SHA:',data.get('sha')) for entry in data.get('tree', []): p=entry['path'] if p.endswith('.py') and any(w in p.lower() for w in ['tool','agent','task','confirmation']): print(p)except Exception as e: print('FETCH ERROR:',type(e).__name__,str(e))PY
Sources consulted:
- context_agent/CHANGELOG.md at main · nextcloud/context_agent · GitHub — https://github.com/nextcloud/context_agent/blob/main/CHANGELOG.md
- Releases - Nextcloud Context Agent - Apps - App Store - Nextcloud — https://apps.nextcloud.com/apps/context_agent/releases?platform=31
- Releases - Nextcloud Context Agent - Apps - App Store - Nextcloud — https://apps.nextcloud.com/apps/context_agent/releases?platform=34
- …and 45 more
Script executed:
python3 - <<'PY'import json, urllib.requestbase='https://api.github.com/repos/nextcloud/context_agent/'def get(path): with urllib.request.urlopen(urllib.request.Request(base+path, headers={'User-Agent':'evidence-inspection'}), timeout=30) as r: return json.load(r)try: tags=get('tags?per_page=100') print('Relevant tags:', [(t['name'],t['commit']['sha']) for t in tags if any(v in t['name'] for v in ('2.8','2.9','2.10'))]) for t in tags: if '2.8.0' in t['name']: data=get('git/trees/'+t['commit']['sha']+'?recursive=1') print('TREE',t['name'],data.get('sha'),'truncated',data.get('truncated')) for entry in data.get('tree',[]): p=entry['path'] if p.endswith('.py') and any(w in p.lower() for w in ['tool','agent','task','confirmation']): print(p) breakexcept Exception as e: print('FETCH ERROR:',type(e).__name__,str(e))PY
Repository: nextcloud/assistant
Length of output: 1636
Script executed:
python3 - <<'PY'import urllib.requestroot='https://raw.githubusercontent.com/nextcloud/context_agent/99936dd8c518b164aae8bdb12e965a640fe6f1fc/'paths=['ex_app/lib/agent.py','ex_app/lib/all_tools/files.py','ex_app/lib/all_tools/forms.py','ex_app/lib/all_tools/lib/decorator.py','ex_app/lib/tools.py']for p in paths: try: with urllib.request.urlopen(root+p, timeout=25) as r: lines=r.read().decode().splitlines() print('\n###',root+p) hits=[i for i,l in enumerate(lines) if any(w in l.lower() for w in ['pending','interrupt','confirm','delete_','destructive','reversibility','actions'])] spans=[] for i in hits: a=max(0,i-5); b=min(len(lines),i+11) if spans and a<=spans[-1][1]: spans[-1]=(spans[-1][0],max(b,spans[-1][1])) else: spans.append((a,b)) for a,b in spans: print('---') for i in range(a,b): print(f'{i+1:4} {lines[i]}') except Exception as e: print('FETCH ERROR',p,type(e).__name__,str(e))PY
Repository: nextcloud/assistant
Length of output: 8967
Script executed:
python3 - <<'PY'import urllib.requestroot='https://raw.githubusercontent.com/nextcloud/context_agent/99936dd8c518b164aae8bdb12e965a640fe6f1fc/'for p, ranges in {'ex_app/lib/agent.py':[(1,125),(175,235),(235,298)],'ex_app/lib/all_tools/files.py':[(320,370)],'pyproject.toml':[(1,120)],}.items(): try: with urllib.request.urlopen(root+p, timeout=25) as r: lines=r.read().decode().splitlines() print('\n###',root+p) for a,b in ranges: for i in range(a-1,min(b,len(lines))): print(f'{i+1:4} {lines[i]}') except Exception as e: print('FETCH ERROR',p,type(e).__name__,str(e))PY
Repository: nextcloud/assistant
Length of output: 14889
Web query:
Langchain Python ToolCall TypedDict name args id type optional langchain_core messages tool tool_calls
python3 - <<'PY'import urllib.requestroot='https://raw.githubusercontent.com/nextcloud/context_agent/99936dd8c518b164aae8bdb12e965a640fe6f1fc/'for p, needles in {'ex_app/lib/nc_model.py':['tool_calls','tool_call','AIMessage'],'ex_app/lib/graph.py':['dangerous_tools','interrupt','tool_calls','ToolNode'],'ex_app/lib/all_tools/lib/decorator.py':['dangerous_tool'],'ex_app/lib/tools.py':['dangerous','get_tools'],'appinfo/info.xml':['nextcloud']}.items(): try: with urllib.request.urlopen(root+p, timeout=25) as r: lines=r.read().decode().splitlines() print('\n###',root+p) spans=[] for i,l in enumerate(lines): if any(n in l for n in needles): a=max(0,i-8); b=min(len(lines),i+15) if spans and a<=spans[-1][1]: spans[-1]=(spans[-1][0],max(b,spans[-1][1])) else: spans.append((a,b)) for a,b in spans: print('---') for i in range(a,b): print(f'{i+1:4} {lines[i]}') except Exception as e: print('FETCH ERROR',p,type(e).__name__,str(e))PY
Repository: nextcloud/assistant
Length of output: 19980
Warn when destructiveness is unknown.
With Context Agent 2.8.0, a pending file deletion has no destructive or reversibility field. The dialog therefore shows an info card without the content-loss indicator. Show an unknown-risk warning when destructiveness is missing instead of treating the action as non-destructive.
nl -ba lib/Listener/ChattyLLMTaskListener.php | sed -n '110,190p'
nl -ba lib/Controller/ChattyLLMController.php | sed -n '590,630p;670,725p'
rg -n -F 'function improveAgencyActionNames' lib/Controller/ChattyLLMController.php
nl -ba src/components/ChattyLLM/ChattyLLMInputForm.vue | sed -n '610,645p;1470,1510p'
nl -ba openapi.json | sed -n '60,100p;205,250p'
curl -fsSL 'https://api.github.com/repos/nextcloud/context_agent/git/trees/v2.11.0?recursive=1'| python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(x["path"] for x in d.get("tree",[]) if x["path"].endswith(".py") and ("classif" in x["path"] or "agent" in x["path"] or "tool" in x["path"])))'
forspecin'ex_app/lib/agent.py:1:100''ex_app/lib/all_tools/lib/impulse.py:315:344''ex_app/lib/all_tools/lib/impulse.py:407:445''ex_app/lib/all_tools/files.py:1:180''ex_app/lib/all_tools/lib/files.py:1:220';do
IFS=: read -r path first last <<<"$spec"printf'\n--- context_agent v2.11.0 %s:%s-%s ---\n'"$path""$first""$last"
curl -fsSL "https://raw.githubusercontent.com/nextcloud/context_agent/v2.11.0/$path"| nl -ba | sed -n "${first},${last}p"done
curl -fsSL 'https://api.github.com/repos/nextcloud/context_agent/git/trees/v2.11.0?recursive=1'| python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(x["path"] for x in d.get("tree",[]) if x["path"].endswith(".py") and ("graph" in x["path"] or "classification" in x["path"])))'
printf'%s\n''--- Nextcloud server stable35 ContextAgentInteraction ---'
curl -fsSL 'https://raw.githubusercontent.com/nextcloud/server/stable35/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php'| nl -ba | sed -n '15,135p'
nl -ba lib/Service/ChatService.php | sed -n '620,650p;840,895p'
nl -ba src/components/ChattyLLM/AgencyAction.vue | sed -n '1,150p'
Repository: nextcloud/assistant
Length of output: 10611
Show when the total item count is unknown.
If one action omits item_count, the dialog treats it as zero. A batch with another count of 5 then reports exactly 5 affected items, even if the omitted action affects more. Mark the total as unknown instead of presenting the partial sum as exact.
Sources consulted:
- Releases - Nextcloud Context Agent - Apps - App Store - Nextcloud — https://apps.nextcloud.com/apps/context_agent/releases?platform=31
- GitHub - nextcloud/context_agent · GitHub — https://github.com/nextcloud/context_agent
- Nextcloud Context Agent - Apps - App Store - Nextcloud — https://apps.nextcloud.com/apps/context_agent
- context_agent/CHANGELOG.md at main · nextcloud/context_agent · GitHub — https://github.com/nextcloud/context_agent/blob/main/CHANGELOG.md
- context_agent/pyproject.toml at main · nextcloud/context_agent · GitHub — https://github.com/nextcloud/context_agent/blob/main/pyproject.toml
- …and 13 more
Script executed:
python3 - <<'PY'import urllib.requestroot='https://raw.githubusercontent.com/nextcloud/context_agent/5fdcad6cd0a5517443ac612c59928a69d1e6fa2b/'paths=['ex_app/lib/agent.py','ex_app/lib/graph.py','ex_app/lib/tools.py','ex_app/lib/all_tools/files.py','ex_app/lib/all_tools/lib/files.py','ex_app/lib/all_tools/lib/impulse.py','ex_app/lib/main.py','tests/test_confirmation_policy.py']terms=['item_count_exact','item_count','count_limit','pending_actions']for path in paths: try: req=urllib.request.Request(root+path,headers={'User-Agent':'code-review'}) lines=urllib.request.urlopen(req,timeout=20).read().decode().splitlines() except Exception as e: print('ERROR',path,e); continue hits=[i for i,s in enumerate(lines) if any(t in s for t in terms)] print('\n###',root+path,'lines',len(lines),'hits',len(hits)) show=set() for i in hits: show.update(range(max(0,i-5),min(len(lines),i+7))) for i in sorted(show): print(f'{i+1:4} {lines[i]}')PY
rg -n -F -e 'setAgencyPendingActions' -e 'improveAgencyActionNames' -e 'sessionAgencyPendingActions' -- lib src/components/ChattyLLM/ChattyLLMInputForm.vue
nl -ba lib/Controller/ChattyLLMController.php | sed -n '580,720p'
Repository: nextcloud/assistant
Length of output: 34534
Script executed:
python3 - <<'PY'import urllib.requestroot='https://raw.githubusercontent.com/nextcloud/context_agent/5fdcad6cd0a5517443ac612c59928a69d1e6fa2b/'for path in ['ex_app/lib/graph.py','ex_app/lib/agent.py','ex_app/lib/main.py']: lines=urllib.request.urlopen(urllib.request.Request(root+path,headers={'User-Agent':'code-review'}),timeout=20).read().decode().splitlines() print('\n###',root+path) terms=['annotate(', 'pending', 'tool_calls', 'actions', 'interrupt', 'output'] hits=[i for i,s in enumerate(lines) if any(t in s for t in terms)] show=set() for i in hits: show.update(range(max(0,i-4),min(len(lines),i+6))) for i in sorted(show): print(f'{i+1:4} {lines[i]}')PY
nl -ba lib/Listener/ChattyLLMTaskListener.php | sed -n '105,195p'
nl -ba lib/Controller/ChattyLLMController.php | sed -n '165,215p'
nl -ba src/components/ChattyLLM/ChattyLLMInputForm.vue | sed -n '610,650p;1470,1510p'
Repository: nextcloud/assistant
Length of output: 26886
Show capped counts as lower bounds.
When Context Agent caps a folder count, this dialog presents the cap as an exact total. A folder with more than 11 items can therefore appear to affect only 11. Check item_count_exact and display an inexact count as a lower bound.
The reason will be displayed to describe this comment to others. Learn more.
Should we cast to int? Right now it seems possible to render float counts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI (if applicable)