mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
tweak(tui/spinner): set spinner generation reasoning effort to Medium\n\n- Use ReasoningEffort::Medium for the background spinner JSON-schema turn\n- Keeps quality while avoiding earlier Minimal/Low issues\n- Scoped only to spinner generation; main turns unchanged
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
name: Issue Comment (Preview)
|
name: Issue Comment
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Automatic: when Preview Build finishes successfully for a PR
|
# Automatic: when Preview Build finishes successfully for a PR
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["Preview Build"]
|
workflows: ["Preview Build"]
|
||||||
types: [completed]
|
types: [completed]
|
||||||
|
# From triage (or elsewhere): direct repository dispatch
|
||||||
|
repository_dispatch:
|
||||||
|
types: [issue-comment]
|
||||||
# Manual: allow maintainers to trigger for a specific PR
|
# Manual: allow maintainers to trigger for a specific PR
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -12,6 +15,20 @@ on:
|
|||||||
description: "PR number to post preview comment to linked issue"
|
description: "PR number to post preview comment to linked issue"
|
||||||
required: true
|
required: true
|
||||||
type: number
|
type: number
|
||||||
|
type:
|
||||||
|
description: "comment type (preview|comment)"
|
||||||
|
required: false
|
||||||
|
default: preview
|
||||||
|
type: choice
|
||||||
|
options: [preview, comment]
|
||||||
|
issue_number:
|
||||||
|
description: "Issue number (for type=comment)"
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
context:
|
||||||
|
description: "Optional context to include in the comment"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: issue-comment-${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || github.event.workflow_run.id }}
|
group: issue-comment-${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || github.event.workflow_run.id }}
|
||||||
@@ -30,7 +47,7 @@ jobs:
|
|||||||
(github.event_name == 'workflow_run' &&
|
(github.event_name == 'workflow_run' &&
|
||||||
github.event.workflow_run.event == 'pull_request' &&
|
github.event.workflow_run.event == 'pull_request' &&
|
||||||
github.event.workflow_run.conclusion == 'success')
|
github.event.workflow_run.conclusion == 'success')
|
||||||
|| github.event_name == 'workflow_dispatch'
|
|| (github.event_name == 'workflow_dispatch' && (inputs.type == 'preview' || !inputs.type))
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -407,3 +424,46 @@ jobs:
|
|||||||
} else {
|
} else {
|
||||||
await github.rest.issues.createComment({ owner, repo, issue_number, body });
|
await github.rest.issues.createComment({ owner, repo, issue_number, body });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatch_comment:
|
||||||
|
name: Post triage comment to issue (dispatch)
|
||||||
|
if: github.event_name == 'repository_dispatch' && github.event.action == 'issue-comment'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Post comment from triage
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.CODE_GH_PAT || secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const owner = context.repo.owner; const repo = context.repo.repo;
|
||||||
|
const p = context.payload.client_payload || {};
|
||||||
|
const issue_number = Number(p.issue_number || 0);
|
||||||
|
const type = String(p.type || 'comment');
|
||||||
|
const slug = String(p.slug || '');
|
||||||
|
const info = String(p.context || '').trim();
|
||||||
|
if (!issue_number) { core.setFailed('Missing issue_number in client_payload'); return; }
|
||||||
|
const ISSUE_MARK = '<!-- triage:comment -->';
|
||||||
|
let body = '';
|
||||||
|
if (type === 'comment') {
|
||||||
|
const lines = [];
|
||||||
|
lines.push(ISSUE_MARK);
|
||||||
|
lines.push(`Thanks @${context.actor}! This issue was auto-reviewed.`);
|
||||||
|
lines.push('');
|
||||||
|
lines.push('For safety, the bot did not auto-apply changes.');
|
||||||
|
if (info) { lines.push(''); lines.push(info); }
|
||||||
|
if (slug) {
|
||||||
|
lines.push('');
|
||||||
|
lines.push('You can still explore a local preview in your terminal:');
|
||||||
|
lines.push('```bash');
|
||||||
|
lines.push(`code preview ${slug}`);
|
||||||
|
lines.push('```');
|
||||||
|
}
|
||||||
|
lines.push(ISSUE_MARK);
|
||||||
|
body = lines.join('\n');
|
||||||
|
const all = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number, per_page: 100 });
|
||||||
|
const mine = all.find(c => c.user?.type?.toLowerCase().includes('bot') && (c.body || '').includes(ISSUE_MARK));
|
||||||
|
if (mine) await github.rest.issues.updateComment({ owner, repo, comment_id: mine.id, body });
|
||||||
|
else await github.rest.issues.createComment({ owner, repo, issue_number, body });
|
||||||
|
} else {
|
||||||
|
core.notice(`Unhandled type for issue-comment dispatch: ${type}`);
|
||||||
|
}
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ jobs:
|
|||||||
else
|
else
|
||||||
# Heuristic upgrade: treat straightforward features/docs/typos etc. as safe to attempt
|
# Heuristic upgrade: treat straightforward features/docs/typos etc. as safe to attempt
|
||||||
text="$(printf '%s\n%s\n' "${ISSUE_TITLE:-}" "${ISSUE_BODY:-}" | tr '[:upper:]' '[:lower:]')"
|
text="$(printf '%s\n%s\n' "${ISSUE_TITLE:-}" "${ISSUE_BODY:-}" | tr '[:upper:]' '[:lower:]')"
|
||||||
if echo "$text" | grep -E -q '(feat|feature request|enhancement|docs|documentation|readme|typo|spelling|grammar|broken link|link fix|example|usage|lint|format|style|rename|comment|minor fix)'; then
|
if echo "$text" | grep -E -q '(feat|feature request|enhancement|docs|documentation|readme|typo|spelling|grammar|broken link|link fix|example|usage|lint|format|style|rename|minor fix)'; then
|
||||||
agent_mode='full'
|
agent_mode='full'
|
||||||
else
|
else
|
||||||
agent_mode='comment'
|
agent_mode='comment'
|
||||||
@@ -510,27 +510,24 @@ jobs:
|
|||||||
let label = allow && mode === 'full' ? 'triage/allow' : (allow ? 'triage/allow' : 'triage/block');
|
let label = allow && mode === 'full' ? 'triage/allow' : (allow ? 'triage/allow' : 'triage/block');
|
||||||
try { await github.rest.issues.addLabels({ owner, repo, issue_number, labels: [label] }); } catch {}
|
try { await github.rest.issues.addLabels({ owner, repo, issue_number, labels: [label] }); } catch {}
|
||||||
|
|
||||||
- name: If no changes, post a helpful comment
|
- name: Queue issue-comment (comment mode)
|
||||||
timeout-minutes: 5
|
if: steps.safety.outputs.decision != 'block' && (steps.gate.outputs.allow_agent != 'true' || steps.gate.outputs.agent_mode != 'full')
|
||||||
if: steps.gate.outputs.allow_agent != 'true' || steps.gate.outputs.agent_mode != 'full'
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.CODE_GH_PAT }}
|
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs');
|
const owner = context.repo.owner; const repo = context.repo.repo;
|
||||||
const p = '.github/auto/ISSUE_COMMENT.md';
|
const issue_number = Number(process.env.ISSUE_NUMBER);
|
||||||
let body = '';
|
const slug = `${{ steps.slug.outputs.slug }}`;
|
||||||
if (fs.existsSync(p)) body = fs.readFileSync(p, 'utf8').trim();
|
const decision = '${{ steps.safety.outputs.decision }}';
|
||||||
if (!body) {
|
const rr = `${{ steps.rate_limit.outputs.reason }}` || '';
|
||||||
body = [
|
const rs = `${{ steps.safety.outputs.reason }}` || '';
|
||||||
`Thanks @${context.actor}! I reviewed this issue.`,
|
const lines = [];
|
||||||
'',
|
lines.push(`Decision: ${decision}`);
|
||||||
'Right now there aren’t concrete code changes to apply.',
|
if (rr) lines.push(`Rate: ${rr}`);
|
||||||
'Please add reproduction steps, expected vs actual behavior, and any logs so we can proceed.',
|
if (rs) lines.push(`Safety: ${rs}`);
|
||||||
].join('\n');
|
const contextText = lines.join('\n');
|
||||||
}
|
await github.rest.repos.createDispatchEvent({ owner, repo, event_type: 'issue-comment', client_payload: { type: 'comment', issue_number, slug, context: contextText } });
|
||||||
const payload = { owner: context.repo.owner, repo: context.repo.repo, issue_number: Number(process.env.ISSUE_NUMBER), body };
|
core.notice(`Queued issue-comment for #${issue_number} (comment mode)`);
|
||||||
await github.rest.issues.createComment(payload);
|
|
||||||
|
|
||||||
- name: Queue implementation (issue-code workflow)
|
- name: Queue implementation (issue-code workflow)
|
||||||
if: steps.gate.outputs.allow_agent == 'true' && steps.gate.outputs.agent_mode == 'full'
|
if: steps.gate.outputs.allow_agent == 'true' && steps.gate.outputs.agent_mode == 'full'
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ impl ThemeSelectionView {
|
|||||||
std::sync::Arc::new(cfg.clone()),
|
std::sync::Arc::new(cfg.clone()),
|
||||||
Some(auth_mgr),
|
Some(auth_mgr),
|
||||||
cfg.model_provider.clone(),
|
cfg.model_provider.clone(),
|
||||||
cfg.model_reasoning_effort,
|
codex_core::config_types::ReasoningEffort::Medium,
|
||||||
cfg.model_reasoning_summary,
|
cfg.model_reasoning_summary,
|
||||||
cfg.model_text_verbosity,
|
cfg.model_text_verbosity,
|
||||||
uuid::Uuid::new_v4(),
|
uuid::Uuid::new_v4(),
|
||||||
|
|||||||
Reference in New Issue
Block a user