Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: repoint JIRA search calls to the non-deprecated endpoint, drop the false expiry heuristic

Adam Eivy33a83f783b60
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 9b6c476c0f..ddae1f27e7 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -68,6 +68,8 @@
## Fixed
+- **JIRA sprint tickets and the app JIRA board now load again.** Every JQL search PortOS runs — the app JIRA tab's sprint board, epic search, the config panel's board picker context, and JIRA status reports — called the classic `GET /rest/api/2/search`, which Atlassian has since sunset; the instance now answers with a bare `410 Gone` that the board's error banner could only report as "HTTP 410," with no hint that the fix was on PortOS's side rather than the saved token. All five call sites now use the replacement `search/jql` endpoint, which returns the same v2 field shapes so no downstream mapping changed.
+- **The JIRA instance list no longer tells you a working token is "likely expired."** The card guessed expiry from a hardcoded 30-day PAT lifetime, but that number isn't a real platform constant — Cloud API tokens commonly don't expire on a fixed schedule at all, and Server/DC PAT expiration is chosen per-token by whoever generated it. A token that had authenticated successfully for 35+ days was flagged "likely expired — regenerate your PAT" anyway. The card now shows a neutral token age and, once it's been a while, nudges you to press the existing Test button — the only thing that actually knows whether a token still works — instead of asserting an expiry it can't verify.
- **A creative commission pinned to Grok now actually renders on Grok.** Commissions have been able to name their video backend — Grok, or local with a specific local video model — for a while, but the pin only reached renders the Creative Director's *planner* queued. The scene-by-scene render path, which is where a commission's video is actually produced, never read it: every scene went to the local MLX runtime regardless, the pinned local model was ignored in favor of the project's creation-time default, and an install with no local Python configured failed the whole project up front even when Grok was the configured, enabled, pinned backend. Both paths now resolve the backend through one shared ladder — the commission's own pin, then the install-wide Creative Agent render default, then the global video pin — so what the form says is what renders. Grok's 6s/10s-only clip lengths are covered by rounding a scene's duration up rather than letting it silently come back short, and the project's aspect ratio carries through to Grok's base image. A pin naming a backend whose toggle has since been switched off still degrades to local rather than failing a nightly run, and if local is unconfigured too, the scene now says the pinned backend is disabled instead of only asking for a Python path.
- **A commission's video backend now survives the teaser hand-off, and its pinned local model reaches the planner.** Two leaks were left after the render paths were unified. First, when a commission's plan reaches for "produce a teaser from this issue," that tool mints a *separate* Creative Director project — and it was minted unpinned, so the run's actual deliverable rendered on the install default while the commission said Grok. The teaser now inherits the calling project's backend pin and video model; the pin is read from the project record rather than exposed to the planner, so the model writing the plan cannot pick a render backend of its own. Second, a pinned local video model was stored only on the commission's backend pin, leaving the project's own model on the install default — which is the value the Creative Director's planner prompt reports to the model, so the plan was written against a model that was never going to render it. The chosen video model is now the project's model too. A commission that pins nothing still behaves exactly as before.
- **[issue-3728] The Antigravity code reviewer can finally be pinned to a model, not just an effort.** Every reviewer row offered Antigravity an Effort cell and then told you it "takes no model" — but `agy --model <id>` is real (PortOS already passes it for its own Antigravity runs, and slashdo accepts an `antigravity[<model>]` selector), so the reviewer was silently left on agy's own default, which can be a slow Thinking tier. Antigravity now gets a Model cell everywhere the reviewer picker appears — Code Review Defaults, the task form, the CoS schedule tab, and the slashdo run drawer — populated from agy's installed catalog and free-text so a tier newer than the stored snapshot still works. Because agy lists each reasoning tier as its own model id (`gemini-3.6-flash-high`) while the row already has an Effort control, the picker offers the base ids and PortOS splits a suffixed id you type back into `--model <base> --effort <tier>`, which is the pair agy actually accepts; an effort you picked yourself always wins over the one baked into the id.
diff --git a/client/src/pages/Jira.jsx b/client/src/pages/Jira.jsx
index d1e9d3b71c..c7ec9a8f23 100644
--- a/client/src/pages/Jira.jsx
+++ b/client/src/pages/Jira.jsx
@@ -6,15 +6,17 @@ import { FormField } from '../components/ui/FormField';
import Modal from '../components/ui/Modal';
import api from '../services/api';
-const TOKEN_LIFETIME_DAYS = 30;
-const TOKEN_WARN_DAYS = 5;
-
-function getTokenExpiry(tokenUpdatedAt) {
+// PAT lifetimes aren't a fixed platform constant — Cloud API tokens typically don't
+// expire on a schedule at all, and Server/DC PAT expiration is chosen per-token by
+// whoever generated it. So there's no age threshold that reliably means "expired"
+// (a real instance was still authenticating fine 35+ days after its last save).
+// This is a soft, non-committal nudge — the Test button is the only real signal.
+const TOKEN_STALE_WARN_DAYS = 60;
+
+function getTokenAgeDays(tokenUpdatedAt) {
if (!tokenUpdatedAt) return null;
const updated = new Date(tokenUpdatedAt);
- const expiresAt = new Date(updated.getTime() + TOKEN_LIFETIME_DAYS * 86400000);
- const daysLeft = Math.ceil((expiresAt - Date.now()) / 86400000);
- return { daysLeft, expiresAt };
+ return Math.floor((Date.now() - updated.getTime()) / 86400000);
}
export default function Jira() {
@@ -351,20 +353,15 @@ export default function Jira() {
API Token: {instance.hasApiToken ? '✓ Configured' : '✗ Not set'}
</p>
{instance.hasApiToken && (() => {
- const expiry = getTokenExpiry(instance.tokenUpdatedAt);
- if (!expiry) return (
+ const ageDays = getTokenAgeDays(instance.tokenUpdatedAt);
+ if (ageDays === null) return (
<p className="text-port-warning text-sm mt-1">
- Token age unknown — re-save to start tracking expiry
- </p>
- );
- if (expiry.daysLeft <= 0) return (
- <p className="text-port-error text-sm font-medium mt-1">
- Token likely expired — regenerate your PAT
+ Token age unknown — re-save to start tracking age
</p>
);
- if (expiry.daysLeft <= TOKEN_WARN_DAYS) return (
- <p className="text-port-warning text-sm font-medium mt-1">
- Token expires in {expiry.daysLeft} day{expiry.daysLeft !== 1 ? 's' : ''} — regenerate soon
+ if (ageDays >= TOKEN_STALE_WARN_DAYS) return (
+ <p className="text-port-warning text-sm mt-1">
+ Token saved {ageDays} days ago — click Test to confirm it&apos;s still valid
</p>
);
return null;
diff --git a/server/services/jira.js b/server/services/jira.js
index 8f14550f80..df880548ee 100644
--- a/server/services/jira.js
+++ b/server/services/jira.js
@@ -148,7 +148,11 @@ export function createJiraClient(instance) {
get: (...args) => base.get(...args).then(checkToken, mapAuthError),
post: (...args) => base.post(...args).then(checkToken, mapAuthError),
put: (...args) => base.put(...args).then(checkToken, mapAuthError),
- delete: (...args) => base.delete(...args).then(checkToken, mapAuthError)
+ delete: (...args) => base.delete(...args).then(checkToken, mapAuthError),
+ // Atlassian sunset the old `GET /rest/api/2/search` (410 Gone) — `/search/jql` is
+ // its replacement and keeps the same v2 field shapes, just cursor-paginated. Every
+ // JQL search goes through here so the next endpoint change is a one-line fix.
+ search: (params) => base.get('/rest/api/2/search/jql', { params }).then(checkToken, mapAuthError)
};
}
@@ -286,9 +290,7 @@ export async function searchIssues(instanceId, jql, { fields = 'summary,status,l
}
const client = createJiraClient(instance);
- const response = await client.get('/rest/api/2/search', {
- params: { jql, fields, maxResults }
- });
+ const response = await client.search({ jql, fields, maxResults });
return (response.data.issues || []).map(issue => ({
key: issue.key,
@@ -455,12 +457,10 @@ export async function fetchMyCurrentSprintTickets(instanceId, projectKey) {
// JQL to find tickets assigned to current user in active sprint for the project
const jql = `project = "${escapeJql(projectKey)}" AND assignee = currentUser() AND sprint in openSprints() ORDER BY priority DESC, updated DESC`;
- const response = await client.get('/rest/api/2/search', {
- params: {
- jql,
- fields: 'summary,status,priority,issuetype,assignee,updated,customfield_10106',
- maxResults: 50
- }
+ const response = await client.search({
+ jql,
+ fields: 'summary,status,priority,issuetype,assignee,updated,customfield_10106',
+ maxResults: 50
});
return response.data.issues.map(issue => ({
@@ -635,12 +635,10 @@ export async function searchEpics(instanceId, projectKey, query) {
const safeQuery = escapeJql(query);
const jql = `project = "${safeProject}" AND issuetype = Epic AND summary ~ "${safeQuery}" ORDER BY updated DESC`;
- const response = await client.get('/rest/api/2/search', {
- params: {
- jql,
- fields: 'summary,status',
- maxResults: 10
- }
+ const response = await client.search({
+ jql,
+ fields: 'summary,status',
+ maxResults: 10
});
return response.data.issues.map(issue => ({
diff --git a/server/services/jiraReports.js b/server/services/jiraReports.js
index f4c680bd13..df0bbfd475 100644
--- a/server/services/jiraReports.js
+++ b/server/services/jiraReports.js
@@ -32,12 +32,10 @@ async function getSprintTickets(instance, projectKey) {
const client = createJiraClient(instance);
const jql = `project = "${projectKey}" AND assignee = currentUser() AND sprint in openSprints() ORDER BY status ASC, priority DESC, updated DESC`;
- const response = await client.get('/rest/api/2/search', {
- params: {
- jql,
- fields: 'summary,status,priority,issuetype,assignee,updated,created,customfield_10106,resolution',
- maxResults: 100
- }
+ const response = await client.search({
+ jql,
+ fields: 'summary,status,priority,issuetype,assignee,updated,created,customfield_10106,resolution',
+ maxResults: 100
});
return (response.data?.issues || []).map(issue => ({
@@ -51,12 +49,10 @@ async function getRecentlyCompleted(instance, projectKey) {
const client = createJiraClient(instance);
const jql = `project = "${projectKey}" AND assignee = currentUser() AND status changed to Done AFTER -7d ORDER BY updated DESC`;
- const response = await client.get('/rest/api/2/search', {
- params: {
- jql,
- fields: 'summary,status,priority,issuetype,assignee,updated,customfield_10106,resolutiondate',
- maxResults: 50
- }
+ const response = await client.search({
+ jql,
+ fields: 'summary,status,priority,issuetype,assignee,updated,customfield_10106,resolutiondate',
+ maxResults: 50
});
return (response.data?.issues || []).map(issue => ({