Skip to content

Fix: task.addattachment blocked by restricted command mode (0.3.1)#23

Merged
jochen-testingbot merged 1 commit into
masterfrom
fix-addattachment-restriction
Jul 18, 2026
Merged

Fix: task.addattachment blocked by restricted command mode (0.3.1)#23
jochen-testingbot merged 1 commit into
masterfrom
fix-addattachment-restriction

Conversation

@jochen-testingbot

@jochen-testingbot jochen-testingbot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Found in live testing 🎯

Running the packaged 0.3.0 TBMain task on a real Microsoft-hosted agent produced this warning, and the build-results tab showed "No test results found":

##vso[task.addattachment] is not allowed in this step due to policy restrictions

Root cause

The restrictions: { commands: { mode: "restricted" } } I added to tb-main/task.json in the Phase 2 "modern task metadata" step does not permit task.addattachment — which is exactly how TBMain hands the results payload to the tab. With it blocked, the attachment is never written, so the (correctly-working) tab has nothing to render.

The mock-test harness doesn't enforce the agent's command policy, so this only showed up on a real run — precisely the live-org validation I flagged as necessary.

Fix

  • Remove commands.mode: "restricted" from tb-main/task.json (keep the settableVariables allowlist — it works and adds real value).
  • Bump 0.3.00.3.1.

tb-stop-tunnel keeps restricted mode: it only emits ##vso[task.complete], which is allowed in restricted mode.

Note

The 0.3.0 draft release has this bug — don't publish 0.3.0; 0.3.1 is the fixed release. Validated end-to-end against a live Azure DevOps org (re-run pending).

Summary by CodeRabbit

  • Chores
    • Updated the package release version to 0.3.1.
    • Adjusted task configuration to remove command restrictions while retaining allowed variable settings.

…live test)

Running the packaged 0.3.0 task on a real agent surfaced:
  ##vso[task.addattachment] is not allowed in this step due to policy
  restrictions
The restrictions.commands.mode="restricted" added to tb-main/task.json in the
Phase 2 "modern task metadata" work does not allow task.addattachment, which is
exactly how TBMain hands the results payload to the build-results tab. With it
blocked, the attachment was never written and the tab showed "No test results
found".

The mock-test harness doesn't enforce the agent's command policy, so this only
appeared on a real run.

- Remove the commands.mode="restricted" restriction from tb-main/task.json
  (keep the settableVariables allowlist, which works and adds real value).
- Bump 0.3.0 -> 0.3.1.

tb-stop-tunnel keeps restricted mode: it only emits ##vso[task.complete], which
IS allowed in restricted mode.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4a87a0d7-6a05-41f4-9f56-bad81b420faa

📥 Commits

Reviewing files that changed from the base of the PR and between 6524964 and 8244598.

⛔ Files ignored due to path filters (2)
  • .DS_Store is excluded by !**/.DS_Store
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • tb-main/package.json
  • tb-main/task.json
  • tb-stop-tunnel/package.json
💤 Files with no reviewable changes (1)
  • tb-main/task.json

📝 Walkthrough

Walkthrough

The package version is updated from 0.3.0 to 0.3.1 in three manifests. The task configuration removes its restricted command mode while retaining the allowed settable variables configuration.

Changes

Package and task updates

Layer / File(s) Summary
Package version alignment
package.json, tb-main/package.json, tb-stop-tunnel/package.json
Updates all three package version fields from 0.3.0 to 0.3.1.
Task command restriction removal
tb-main/task.json
Removes the restricted command configuration from restrictions and retains settableVariables.allowed.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: task.addattachment was blocked by restricted command mode, and the version bump is consistent with the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@jochen-testingbot
jochen-testingbot merged commit a026873 into master Jul 18, 2026
4 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.

1 participant