Skip to content

Commit faad7f0

Browse files
committed
fix: stop pre-blocking native TeamCreate flows
1 parent 946390f commit faad7f0

6 files changed

Lines changed: 13 additions & 37 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"name": "hello2cc",
1212
"description": "Thin Claude Code plugin for third-party models, focused on host state, protocol adaptation, and repeated-failure debounce.",
13-
"version": "0.5.8",
13+
"version": "0.5.9",
1414
"source": "./",
1515
"author": {
1616
"name": "hello2cc"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hello2cc",
3-
"version": "0.5.8",
3+
"version": "0.5.9",
44
"description": "Claude Code alignment plugin that drives third-party models toward Opus-compatible workflows, tool usage, and output style.",
55
"author": {
66
"name": "hello2cc"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# 更新日志
22

3+
## 0.5.9 - 2026-04-12
4+
5+
- 去掉 hello2cc 对 `TeamCreate` 的两条非宿主确定性前置 deny:普通非 team 语义请求、以及“当前已存在 active team”场景都改为交还 Claude Code 原生处理
6+
- 保留占位值 / 保留 assistant team 名拦截,以及已被宿主证明失败的 worktree 重试 fail-closed,这两类仍属于确定性护栏而不是语义越权
7+
- 补充 `pre-team-create` 放行回归测试,确保插件不再越过宿主先拦截原生 `TeamCreate`
8+
39
## 0.5.8 - 2026-04-12
410

511
- 去掉 hello2cc 对 `TaskUpdate(owner/addBlocks/addBlockedBy)` 的越界前置 deny,恢复到 Claude Code 原生 `TaskUpdate` 先执行、由宿主自身处理输入的边界

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hello2cc",
3-
"version": "0.5.8",
3+
"version": "0.5.9",
44
"type": "module",
55
"description": "Claude Code alignment plugin that drives third-party models toward Opus-compatible workflows, tool usage, and output style.",
66
"license": "Apache-2.0",

scripts/lib/agent-input.mjs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ function joinReasons(...items) {
1616
return items.filter(Boolean).join('; ');
1717
}
1818

19-
function sameCaseInsensitiveValue(left, right) {
20-
return readTrimmed(left).toLowerCase() === readTrimmed(right).toLowerCase();
21-
}
22-
2319
export function normalizeAgentTeamSemantics(input = {}, sessionContext = {}) {
2420
const rawWorkerName = readTrimmed(input?.name);
2521
const workerName = participantNameOrEmpty(rawWorkerName);
@@ -132,8 +128,6 @@ export function normalizeAgentIsolation(input = {}, sessionContext = {}) {
132128
export function normalizeTeamCreateInput(input = {}, sessionContext = {}) {
133129
const rawRequestedTeamName = readTrimmed(input?.team_name);
134130
const requestedTeamName = realTeamNameOrEmpty(rawRequestedTeamName);
135-
const activeTeamName = realTeamNameOrEmpty(sessionContext?.teamName);
136-
const teamSemantics = hasIntentTeamSemantics(sessionContext);
137131

138132
if (rawRequestedTeamName && !requestedTeamName) {
139133
return {
@@ -144,28 +138,6 @@ export function normalizeTeamCreateInput(input = {}, sessionContext = {}) {
144138
};
145139
}
146140

147-
if (!teamSemantics) {
148-
return {
149-
input,
150-
changed: false,
151-
blocked: true,
152-
reason: 'hello2cc blocked TeamCreate because the current request does not imply sustained team semantics; plain workers should stay on Agent without creating a native team',
153-
};
154-
}
155-
156-
if (
157-
activeTeamName
158-
&& provenActiveTeamContext(sessionContext)
159-
&& (!requestedTeamName || sameCaseInsensitiveValue(requestedTeamName, activeTeamName))
160-
) {
161-
return {
162-
input,
163-
changed: false,
164-
blocked: true,
165-
reason: `hello2cc blocked redundant TeamCreate because a verified active team context already exists (${activeTeamName}); continue via SendMessage, task board tools, and named Agent teammates instead of recreating the same team`,
166-
};
167-
}
168-
169141
return { input, changed: false, reason: '', blocked: false };
170142
}
171143

tests/orchestrator-agent-team.test.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ test('pre-agent-model strips reserved assistant team placeholders', () => {
174174
assert.match(output.hookSpecificOutput.permissionDecisionReason, /implicit assistant team semantics/i);
175175
});
176176

177-
test('pre-team-create denies team creation when the request does not imply sustained team semantics', () => {
177+
test('pre-team-create no longer pre-denies team creation when the request does not imply sustained team semantics', () => {
178178
const env = isolatedEnv();
179179

180180
run('route', {
@@ -191,8 +191,7 @@ test('pre-team-create denies team creation when the request does not imply susta
191191
},
192192
}, env);
193193

194-
assert.equal(output.hookSpecificOutput.permissionDecision, 'deny');
195-
assert.match(output.hookSpecificOutput.permissionDecisionReason, /does not imply sustained team semantics/i);
194+
assert.deepEqual(output, { suppressOutput: true });
196195
});
197196

198197
test('pre-team-create allows native team creation for sustained collaboration requests', () => {
@@ -236,7 +235,7 @@ test('pre-team-create blocks placeholder or reserved assistant team names', () =
236235
assert.match(output.hookSpecificOutput.permissionDecisionReason, /placeholder or reserved assistant team names/i);
237236
});
238237

239-
test('pre-team-create blocks redundant creation of an already active verified team', () => {
238+
test('pre-team-create no longer pre-denies redundant creation of an already active verified team', () => {
240239
const env = isolatedEnv();
241240
const sessionId = 'teamcreate-active-redundant';
242241

@@ -278,8 +277,7 @@ test('pre-team-create blocks redundant creation of an already active verified te
278277
},
279278
}, env);
280279

281-
assert.equal(output.hookSpecificOutput.permissionDecision, 'deny');
282-
assert.match(output.hookSpecificOutput.permissionDecisionReason, /verified active team context already exists/i);
280+
assert.deepEqual(output, { suppressOutput: true });
283281
});
284282

285283
test('pre-enter-worktree no longer pre-denies worktree creation when the prompt did not explicitly request it', () => {

0 commit comments

Comments
 (0)