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:
James Peter
2025-09-13 00:57:15 +10:00
parent 4041693f32
commit beee09fcc0
3 changed files with 79 additions and 22 deletions
+62 -2
View File
@@ -1,10 +1,13 @@
name: Issue Comment (Preview)
name: Issue Comment
on:
# Automatic: when Preview Build finishes successfully for a PR
workflow_run:
workflows: ["Preview Build"]
types: [completed]
# From triage (or elsewhere): direct repository dispatch
repository_dispatch:
types: [issue-comment]
# Manual: allow maintainers to trigger for a specific PR
workflow_dispatch:
inputs:
@@ -12,6 +15,20 @@ on:
description: "PR number to post preview comment to linked issue"
required: true
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:
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.workflow_run.event == 'pull_request' &&
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
steps:
@@ -407,3 +424,46 @@ jobs:
} else {
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}`);
}
+16 -19
View File
@@ -419,7 +419,7 @@ jobs:
else
# 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:]')"
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'
else
agent_mode='comment'
@@ -510,27 +510,24 @@ jobs:
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 {}
- name: If no changes, post a helpful comment
timeout-minutes: 5
if: steps.gate.outputs.allow_agent != 'true' || steps.gate.outputs.agent_mode != 'full'
- name: Queue issue-comment (comment mode)
if: steps.safety.outputs.decision != 'block' && (steps.gate.outputs.allow_agent != 'true' || steps.gate.outputs.agent_mode != 'full')
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CODE_GH_PAT }}
script: |
const fs = require('fs');
const p = '.github/auto/ISSUE_COMMENT.md';
let body = '';
if (fs.existsSync(p)) body = fs.readFileSync(p, 'utf8').trim();
if (!body) {
body = [
`Thanks @${context.actor}! I reviewed this issue.`,
'',
'Right now there aren’t concrete code changes to apply.',
'Please add reproduction steps, expected vs actual behavior, and any logs so we can proceed.',
].join('\n');
}
const payload = { owner: context.repo.owner, repo: context.repo.repo, issue_number: Number(process.env.ISSUE_NUMBER), body };
await github.rest.issues.createComment(payload);
const owner = context.repo.owner; const repo = context.repo.repo;
const issue_number = Number(process.env.ISSUE_NUMBER);
const slug = `${{ steps.slug.outputs.slug }}`;
const decision = '${{ steps.safety.outputs.decision }}';
const rr = `${{ steps.rate_limit.outputs.reason }}` || '';
const rs = `${{ steps.safety.outputs.reason }}` || '';
const lines = [];
lines.push(`Decision: ${decision}`);
if (rr) lines.push(`Rate: ${rr}`);
if (rs) lines.push(`Safety: ${rs}`);
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 } });
core.notice(`Queued issue-comment for #${issue_number} (comment mode)`);
- name: Queue implementation (issue-code workflow)
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()),
Some(auth_mgr),
cfg.model_provider.clone(),
cfg.model_reasoning_effort,
codex_core::config_types::ReasoningEffort::Medium,
cfg.model_reasoning_summary,
cfg.model_text_verbosity,
uuid::Uuid::new_v4(),